/* Custom styles for Coach CRM */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
}

.navbar {
    transition: background-color 0.2s ease;
}

/* Cards */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.card-header {
    border-radius: 8px 8px 0 0;
    font-weight: 500;
}

/* Forms */
.form-control, .form-select {
    border-radius: 6px;
}

.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 6px 0 0 6px;
}

.btn-group .btn:last-child {
    border-radius: 0 6px 6px 0;
}

/* Tables */
.table th {
    border-top: none;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,123,255,0.05);
}

/* Dashboard cards */
.dashboard-stat {
    text-align: center;
    padding: 1.5rem;
}

.dashboard-stat i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Client detail page */
.client-info-section {
    margin-bottom: 1.5rem;
}

.client-info-section h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Conversation styling */
.conversation-notes {
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Theme toggle */
#themeToggle:hover {
    opacity: 0.8;
}

/* ============================================
   LIGHT THEME SPECIFIC STYLES
   ============================================ */
[data-bs-theme="light"] body {
    background-color: #f5f7fa;
    color: #212529;
}

[data-bs-theme="light"] .card {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

[data-bs-theme="light"] .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

[data-bs-theme="light"] .table {
    color: #212529;
}

[data-bs-theme="light"] .table th {
    color: #6c757d;
}

[data-bs-theme="light"] .table-hover tbody tr:hover {
    background-color: rgba(0,123,255,0.04);
}

[data-bs-theme="light"] .list-group-item {
    background-color: #ffffff;
    border-color: #dee2e6;
}

[data-bs-theme="light"] .input-group-text {
    background-color: #e9ecef;
    border-color: #ced4da;
    color: #495057;
}

[data-bs-theme="light"] .dropdown-menu {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

[data-bs-theme="light"] .dropdown-item:hover {
    background-color: #f0f0f0;
}

[data-bs-theme="light"] .alert-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

[data-bs-theme="light"] .alert-info {
    background-color: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

[data-bs-theme="light"] .text-muted {
    color: #6c757d !important;
}

[data-bs-theme="light"] .badge.bg-secondary {
    background-color: #6c757d !important;
}

[data-bs-theme="light"] .progress {
    background-color: #e9ecef;
}

/* ============================================
   DARK THEME SPECIFIC STYLES
   ============================================ */
[data-bs-theme="dark"] body {
    background-color: #1a1d21;
    color: #dee2e6;
}

[data-bs-theme="dark"] .card {
    background-color: #212529;
    border: 1px solid #343a40;
}

[data-bs-theme="dark"] .card-header {
    background-color: #2b3035;
    border-bottom: 1px solid #343a40;
}

[data-bs-theme="dark"] .table th {
    color: #adb5bd;
}

[data-bs-theme="dark"] .list-group-item {
    background-color: #212529;
    border-color: #343a40;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #343a40;
    border-color: #495057;
    color: #adb5bd;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #2b3035;
    border: 1px solid #495057;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #dee2e6;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: #343a40;
    color: #ffffff;
}

[data-bs-theme="dark"] .text-muted {
    color: #9a9da0 !important;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        break-inside: avoid;
    }
    
    .conversation-item {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        break-after: avoid;
    }

    #themeToggle {
        display: none !important;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 6px !important;
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 1rem;
    }

    #themeToggle span {
        display: none;
    }

    /* Volledig-scherm nav menu op mobiel */
    #navbarNav.collapse.show,
    #navbarNav.collapsing {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1045;
        overflow-y: auto;
        padding: 1rem 1.5rem 2rem;
        display: flex !important;
        flex-direction: column;
        background-color: var(--bs-body-bg);
    }

    #navbarNav.collapse.show .navbar-nav,
    #navbarNav.collapsing .navbar-nav {
        flex: 1;
        justify-content: center;
        gap: 0;
    }

    #navbarNav .nav-link {
        font-size: 1.25rem;
        padding: 1rem 0.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    #navbarNav .nav-back-btn {
        font-size: 1rem;
        padding: 0.75rem 0.5rem 1rem;
        border-bottom: 2px solid rgba(255,255,255,0.15);
        margin-bottom: 0.5rem;
    }

    /* Sluitknop rechtsboven in volledig-scherm menu */
    #navMenuSluiten {
        display: flex;
        justify-content: flex-end;
        padding-bottom: 0.5rem;
    }

    /* Actieknop vult volledige rijhoogte op mobiel via absolute positionering in td */
    .td-actie {
        position: relative;
        width: 3.5rem;
        min-width: 3.5rem;
        padding: 0 !important;
    }
    .btn-md-normal {
        position: absolute;
        top: 3px;
        left: 3px;
        right: 3px;
        bottom: 3px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        border-radius: 0;
        border-top: none;
        border-bottom: none;
        border-right: none;
        margin: 0 !important;
    }
}

/* Accessibility improvements */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Verwijder focusrand op klikbare tabelrijen */
.client-rij:focus,
.clickable-row:focus,
.uitnodiging-rij:focus {
    outline: none;
}

/* Loading states */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Status indicators */
.status-active {
    color: var(--bs-success);
}

.status-inactive {
    color: var(--bs-danger);
}

.status-pending {
    color: var(--bs-warning);
}

/* Custom scrollbar for webkit browsers */
[data-bs-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #1a1d21;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #495057;
    border-radius: 4px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

[data-bs-theme="light"] ::-webkit-scrollbar {
    width: 8px;
}

[data-bs-theme="light"] ::-webkit-scrollbar-track {
    background: #f5f7fa;
}

[data-bs-theme="light"] ::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

[data-bs-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* Form validation styles */
.was-validated .form-control:valid {
    border-color: var(--bs-success);
}

.was-validated .form-control:invalid {
    border-color: var(--bs-danger);
}

/* Animation for alerts */
.alert {
    animation: slideIn 0.3s ease-out;
}

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

/* Footer styling */
footer {
    margin-top: auto;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Ensure body takes full height */
html, body {
    height: 100%;
}

#root, .App {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}
