/* App Layout Styles */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Header Styles */
.app-header {
    height: 64px;
    background-color: #1f2945;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-content {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 24px;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 40px;
    width: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.header-dropdown {
    position: relative;
}

.header-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.header-dropdown-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.header-dropdown-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.header-dropdown-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.header-dropdown-btn svg {
    transition: transform 0.2s;
}

.header-dropdown-btn-account .header-account-email {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

@media (max-width: 768px) {
    .header-dropdown-btn-account .header-account-email {
        max-width: 120px;
    }
}

.header-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    color: #374151;
    font-size: 14px;
    transition: background-color 0.15s;
    white-space: nowrap;
}

.dropdown-option:hover {
    background-color: #f3f4f6;
}

.dropdown-option.selected {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.dropdown-option svg {
    flex-shrink: 0;
    color: #6b7280;
}

.dropdown-option:hover svg {
    color: #374151;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Admin preview-as-user banner (fixed below header) */
.impersonation-banner-host {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 99;
    background-color: #fef3c7;
    border-bottom: 1px solid #fcd34d;
    padding: 10px 24px;
    font-size: 14px;
    color: #78350f;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.impersonation-banner-host:empty {
    display: none;
}

.impersonation-exit-btn {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #78350f;
    background: #fde68a;
    border: 1px solid #d97706;
    border-radius: 6px;
    cursor: pointer;
}

.impersonation-exit-btn:hover {
    background: #fcd34d;
}

.app-container--impersonating .app-body {
    margin-top: 112px; /* header + banner */
}

/* App Body Layout */
.app-body {
    display: flex;
    flex: 1;
    margin-top: 64px; /* Account for fixed header */
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 240px;
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-nav {
    padding: 16px 0;
}

.sidebar-item {
    padding: 12px 24px;
    cursor: pointer;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

.sidebar-item.active {
    background-color: #eff6ff;
    color: #2563eb;
    border-left-color: #2563eb;
    font-weight: 600;
}

/* Sidebar Category Styles */
.sidebar-category-header {
    margin-top: 8px;
}

.sidebar-category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    cursor: pointer;
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    user-select: none;
}

.sidebar-category-title:hover {
    color: #374151;
    background-color: #f3f4f6;
}

.sidebar-category-icon {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.sidebar-category-icon.collapsed {
    transform: rotate(-90deg);
}

.sidebar-category-items {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
    opacity: 1;
}

.sidebar-category-items.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.sidebar-category-items .sidebar-item {
    padding-left: 40px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    background-color: #f9fafb;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-content-large {
    max-width: 640px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    padding: 0;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.modal-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.modal-btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.modal-btn-primary:hover {
    background-color: #2563eb;
}

.modal-btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-btn-secondary:hover {
    background-color: #e5e7eb;
}

/* View List Styles */
.view-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.view-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.15s;
}

.view-list-item:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.view-list-item-name {
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    flex: 1;
}

.view-list-item-actions {
    display: flex;
    gap: 8px;
}

.view-action-btn {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    white-space: nowrap;
}

.view-action-btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.view-action-btn-primary:hover {
    background-color: #2563eb;
}

.view-action-btn-secondary {
    background-color: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.view-action-btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.view-action-btn-danger {
    background-color: #ef4444;
    color: #ffffff;
}

.view-action-btn-danger:hover {
    background-color: #dc2626;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 14px;
}

/* Toast Message */
.toast-message {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #10b981;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
}

.toast-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Checkbox Dropdown Styles */
.checkbox-dropdown {
    position: relative;
}

.checkbox-dropdown-btn {
    transition: all 0.15s;
}

.checkbox-dropdown-btn:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-dropdown-menu {
    min-width: 100%;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.checkbox-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.checkbox-dropdown-menu::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.checkbox-dropdown-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.checkbox-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.checkbox-dropdown label {
    user-select: none;
}

.checkbox-dropdown input[type="checkbox"] {
    cursor: pointer;
}

.checkbox-dropdown input[type="checkbox"]:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .header-content {
        padding: 0 16px;
    }
}

@media (max-width: 640px) {
    .app-body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 8px 0;
    }
    
    .sidebar-item {
        white-space: nowrap;
        padding: 8px 16px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .sidebar-item.active {
        border-left: none;
        border-bottom-color: #2563eb;
    }
}


/* RI Interviewer Table Styles */
.ri-table-header {
    background-color: #c5c993;
}

.ri-table-header th {
    background-color: #c5c993;
}

.sortable-header {
    cursor: pointer;
    transition: background-color 0.15s;
}

.sortable-header:hover {
    background-color: rgba(0, 0, 0, 0.05);
}
