.sites-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.sites-header {
    margin-bottom: 3rem;
}

.sites-container .header-content {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 2rem;
}

.sites-container .header-content > div {
    text-align: left;
    flex: 1;
    min-width: 0;
}

.sites-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.sites-header p {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin: 0;
}

.add-studio-btn {
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-start;
    margin-left: auto;
    width: auto;
}

.search-bar {
    margin-bottom: 1.5rem;
}

.sites-container .search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.sites-container .search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.sites-container .loading-message {
    text-align: center;
    padding: 3rem;
}

.sites-container .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sites-container .loading-message p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.sites-container .empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.sites-container .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.sites-container .empty-state h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.sites-container .empty-state p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.site-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e1e8ed;
}

.site-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.site-name {
    font-size: 1.4rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
    flex: 1;
    padding-right: 1rem;
}

.site-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.sites-container .status-active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sites-container .status-inactive {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.sites-container .status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.sites-container .status-unknown {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.site-details {
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    margin-bottom: 0.75rem;
    align-items: flex-start;
}

.detail-label {
    font-weight: 600;
    color: #34495e;
    min-width: 80px;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.detail-value {
    color: #2c3e50;
    flex: 1;
    font-size: 0.9rem;
}

.site-actions {
    text-align: center;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.site-card-buttons {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.site-card-buttons .btn {
    flex: 1;
    justify-content: center;
}

.sites-container .btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 0.5rem;
}

.sites-container .btn-primary {
    background-color: #3498db;
    color: white;
}

.sites-container .btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.sites-container .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.sites-container .btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.sites-container .btn-success {
    background-color: #28a745;
    color: white;
}

.sites-container .btn-success:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.sites-container .btn-icon {
    font-size: 1rem;
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 50px;
    height: 24px;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #28a745;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-slider:hover {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sites-container {
        padding: 1rem;
    }
    
    .sites-header h1 {
        font-size: 2rem;
    }
    
    .sites-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .site-card {
        padding: 1rem;
    }
    
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .site-status {
        align-self: flex-start;
    }
    
    .sites-container .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .add-studio-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Add Studio Modal Styles — scoped under .add-studio-modal */
.add-studio-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.add-studio-modal.visible {
    opacity: 1;
    visibility: visible;
}

.add-studio-modal .modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.add-studio-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.add-studio-modal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
    font-weight: 600;
}

.add-studio-modal .modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.add-studio-modal .modal-close:hover {
    color: #2c3e50;
}

.add-studio-modal .modal-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
}

.add-studio-modal .modal-body > * {
    width: 100%;
    box-sizing: border-box;
}

.add-studio-modal .form-group {
    margin-bottom: 1.25rem;
}

.add-studio-modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #34495e;
    font-size: 0.9rem;
}

.add-studio-modal .form-group.form-group-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.add-studio-modal .form-group.form-group-inline label:first-child {
    margin-bottom: 0;
}

.add-studio-modal .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.add-studio-modal .form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.add-studio-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #ecf0f1;
}

/* Ensure buttons don't stretch full width */
.add-studio-modal .modal-footer .btn {
    width: auto;
}

.add-studio-modal .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.add-studio-modal .btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.add-studio-modal .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.add-studio-modal .btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.add-studio-modal .error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin-top: 1rem;
}

.add-studio-modal .error-icon {
    font-size: 1.2rem;
}

/* ── Desktop ───────────────────────────────────────────────── */
@media (min-width: 769px) {
    .add-studio-modal {
        padding-left: 250px;
    }
}
