/* Interview Q&A Page Styles */

/* Mobile-first design variables */
:root {
    --primary: #2563EB;
    --emerald: #10B981;
    --coral: #FF6B6B;
    --slate-50: #F8FAFC;
    --slate-100: #F1F5F9;
    --slate-600: #475569;
    --slate-800: #1E293B;
}

.interview-qna-container {
    min-height: 100vh;
    background: white;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 100%;
    margin: 0 auto;
}

/* Desktop background */
@media (min-width: 1024px) {
    .interview-qna-container {
        background: #F8FAFC;
    }
}

/* Mobile-first: Center content with max-width on mobile */
@media (max-width: 768px) {
    .interview-qna-container {
        max-width: 375px;
        margin: 0 auto;
    }
}

/* Context Section - Mobile-first design */
.context-section {
    padding: 1rem;
    background: var(--slate-50);
    border-bottom: 1px solid #e2e8f0;
}

.job-selector-display {
    width: 100%;
    padding: 0.75rem;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.job-selector-display:hover {
    border-color: var(--primary);
}

.job-selector-display:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.company-intel-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.company-intel-btn:hover {
    border-color: var(--primary);
}

.progress-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.progress-stat-card {
    background: white;
    padding: 0.75rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
}

/* Category Tabs Section - Mobile-first */
.category-tabs-section {
    display: flex;
    overflow-x: auto;
    padding: 0.75rem 1rem;
    gap: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    background: white;
    position: sticky;
    top: 64px;
    z-index: 40;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-tabs-section::-webkit-scrollbar {
    display: none;
}

.category-tabs {
    display: flex;
    gap: 1.5rem;
    white-space: nowrap;
}

.category-tab {
    white-space: nowrap;
    padding-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.category-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.category-tab:hover:not(.active) {
    color: var(--primary);
}

/* Q&A List Section */
.qa-list-section {
    padding: 1rem;
    padding-bottom: 6rem;
}

/* Analytics Section */
.analytics-section {
    padding: 1rem;
}

/* Active tab styling */
.active-tab {
    border-bottom: 3px solid var(--primary);
    color: var(--primary);
}

/* Pulse animation for loading states */
@keyframes pulse-blue {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse-blue {
    animation: pulse-blue 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Removed header styles - replaced with standard teal navbar */
/*
.interview-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-section i {
    font-size: 2rem;
    color: #667eea;
}

.logo-section h1 {
    color: #333;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.job-info {
    flex: 1;
    text-align: center;
}

.job-info h2 {
    color: #333;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.job-info p {
    color: #666;
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
}

.back-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}
*/

.interview-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    padding-top: 64px; /* Account for fixed navbar */
    display: flex;
    flex-direction: column;
}

/* Desktop Three-Column Layout */
@media (min-width: 1024px) {
    /* Hide mobile layout on desktop */
    .mobile-layout {
        display: none !important;
    }

    /* Show desktop layout */
    .desktop-layout-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
        gap: 1.5rem;
        padding: 2rem;
        max-width: 1440px;
        margin: 0 auto;
        width: 100%;
        position: relative;
        z-index: 1;
    }

    .interview-content {
        max-width: 100%;
        padding: 0;
        padding-top: 64px;
        background: #F8FAFC;
    }

    .interview-qna-container {
        background: #F8FAFC;
    }

    /* Left Sidebar */
    .desktop-sidebar-left {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        min-width: 0;
        max-width: 100%;
    }

    .desktop-context-section {
        background: white;
        padding: 1.5rem;
        border-radius: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border: 1px solid #e2e8f0;
    }

    .desktop-progress-cards {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .desktop-progress-cards > div {
        background: white;
        padding: 1.5rem;
        border-radius: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border: 1px solid #e2e8f0;
    }

    .desktop-analytics {
        background: white;
        padding: 1.5rem;
        border-radius: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border: 1px solid #e2e8f0;
    }

    .desktop-analytics h2 {
        margin-bottom: 1rem;
    }

    /* Center Column */
    .desktop-main-column {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        min-width: 0;
        max-width: 100%;
    }

    .desktop-category-tabs {
        background: white;
        border-radius: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border: 1px solid #e2e8f0;
        padding: 1.5rem;
    }

    .desktop-category-tabs .category-tabs {
        display: flex;
        gap: 2rem;
        border-bottom: 1px solid #f1f5f9;
        padding-bottom: 1rem;
    }

    .desktop-category-tabs .category-tab {
        padding-bottom: 0.75rem;
        font-weight: 700;
        font-size: 1rem;
        color: #64748b;
        background: none !important;
        border: none;
        border-bottom: 3px solid transparent;
        cursor: pointer;
        transition: all 0.2s;
    }

    .desktop-category-tabs .category-tab.active,
    .desktop-category-tabs .category-tab.active-tab {
        color: #2563EB;
        border-bottom-color: #2563EB;
        background: none !important; /* keep tab light so name stays readable */
    }

    .desktop-category-tabs .category-tab:hover:not(.active) {
        color: #2563EB;
    }

    .desktop-qa-list {
        min-width: 0;
        max-width: 100%;
    }

    .desktop-qa-list .qna-list {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    /* Right Sidebar */
    .desktop-sidebar-right {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        min-width: 0;
        max-width: 100%;
    }

    .desktop-sidebar-right section {
        background: white;
        padding: 1.5rem;
        border-radius: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border: 1px solid #e2e8f0;
    }

    /* Ensure proper spacing and containment */
    .desktop-sidebar-left section,
    .desktop-sidebar-right section,
    .desktop-main-column section {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    /* Fix tab navigation to prevent overflow */
    .desktop-category-tabs .category-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .desktop-category-tabs .category-tabs::-webkit-scrollbar {
        display: none;
    }

    .desktop-category-tabs .category-tab {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Ensure QA list items stay contained */
    .desktop-qa-list .qna-item {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    /* LinkedIn profiles styling in right sidebar */
    .desktop-sidebar-right .linkedin-profiles-card {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    /* Cold messages styling in right sidebar */
    .desktop-sidebar-right .cold-messages-card {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    /* Message template cards */
    .desktop-sidebar-right .message-card {
        border: 1px dashed #cbd5e1;
        border-radius: 0.75rem;
        padding: 1rem;
        background: #f8fafc;
        margin-bottom: 0.75rem;
    }

    /* Interview tips styling */
    .desktop-sidebar-right .space-y-4 > div {
        margin-bottom: 1rem;
    }
}

/* Tablet and smaller desktop - keep existing layout */
@media (min-width: 769px) and (max-width: 1023px) {
    .desktop-layout-grid {
        display: none !important;
    }

    .mobile-layout {
        display: block !important;
    }

    .interview-content {
        max-width: 1200px;
        padding: 2rem;
        padding-top: 90px;
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: 2rem;
    }
    
    .context-section {
        grid-column: 1 / -1;
    }
    
    .category-tabs-section {
        grid-column: 1 / -1;
    }
    
    .qa-list-section {
        grid-column: 1;
    }
    
    .analytics-section {
        grid-column: 1;
    }
}

/* Mobile - show mobile layout */
@media (max-width: 768px) {
    .desktop-layout-grid {
        display: none !important;
    }

    .mobile-layout {
        display: block !important;
    }
}

.qna-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Desktop: show qna-container */
@media (min-width: 769px) {
    .qna-container {
        display: block;
    }
}

/* Mobile: hide qna-container wrapper, use direct sections */
@media (max-width: 768px) {
    .qna-container {
        display: none;
    }
}

.job-overview-card {
    padding: 2rem;
    border-bottom: 1px solid #e5e5e5;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
}

.job-overview-card h3 {
    color: #333;
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.overview-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.overview-item {
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.overview-item strong {
    color: #333;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.overview-item span {
    color: #666;
    font-weight: 500;
}

.bookmark-dropdown-wrapper {
    grid-column: 1 / -1;
}

.bookmark-dropdown-container {
    margin-top: 0.5rem;
}

.bookmark-dropdown {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    background: white;
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bookmark-dropdown:hover {
    border-color: #1a73e8;
}

.bookmark-dropdown:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* Custom searchable dropdown styles */
.bookmark-dropdown-hidden {
    display: none !important;
}

.custom-bookmark-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown-display {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    background: white;
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
}

.custom-dropdown-display:hover {
    border-color: #1a73e8;
}

.custom-dropdown-display:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.custom-dropdown-display .display-text {
    flex: 1;
    color: #333;
}

.custom-dropdown-display .display-text.placeholder {
    color: #999;
}

.dropdown-arrow {
    font-size: 0.75rem;
    color: #666;
    transition: transform 0.2s;
    margin-left: 0.5rem;
}

.custom-dropdown-display[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.custom-dropdown-panel.hidden {
    display: none;
}

.bookmark-search-input {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-bottom: 1px solid #e5e5e5;
    border-radius: 8px 8px 0 0;
    font-size: 0.95rem;
    color: #333;
    background: white;
    box-sizing: border-box;
}

.bookmark-search-input:focus {
    outline: none;
    border-bottom-color: #1a73e8;
}

.bookmark-search-input::placeholder {
    color: #999;
}

.bookmark-options-container {
    max-height: 240px;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.bookmark-option-item {
    padding: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
    transition: background-color 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    display: block;
}

.bookmark-option-item:hover,
.bookmark-option-item.highlighted {
    background-color: #f1f7ff;
}

.bookmark-option-item:focus {
    outline: none;
    background-color: #e8f0fe;
}

/* Mobile dropdown: status group headers (grouped by Bookmarked, Applied, etc.) */
.mobile-layout .bookmark-status-group {
    margin-bottom: 0.5rem;
}

.mobile-layout .bookmark-status-group.hidden {
    display: none;
}

.mobile-layout .bookmark-status-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6366f1;
    background: #f1f5f9;
    border-radius: 0.375rem;
    margin: 0.25rem 0.5rem 0.25rem 0;
}

.mobile-layout .bookmark-status-group .bookmark-option-item {
    padding-left: 1rem;
}

.no-results {
    padding: 1rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

.no-results.hidden {
    display: none;
}

/* Scrollbar styling for options container */
.bookmark-options-container::-webkit-scrollbar {
    width: 8px;
}

.bookmark-options-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.bookmark-options-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.bookmark-options-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.qna-categories {
    padding: 2rem;
}

.category-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.category-tab {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e9ecef;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
}

.category-tab:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.category-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.qna-list {
    min-height: 400px;
}

.qna-section {
    display: none;
}

.qna-section.active {
    display: block;
}

.qna-item {
    padding: 1rem;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

/* Priority indicator bar */
.qna-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.qna-item.reviewed::before {
    background: var(--emerald);
}

.qna-item.critical::before {
    background: var(--coral);
}

.qna-item:last-child {
    margin-bottom: 0;
}

.qna-question {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

/* Make qna-question look clickable and show chevron */
.qna-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.qna-question .qna-toggle i {
    transition: transform 0.25s ease;
    color: #6b7280;
}

.qna-item.open .qna-question .qna-toggle i {
    transform: rotate(180deg);
}

.qna-answer {
    display: none;
    background: #f1f5f9;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    color: #475569;
    line-height: 1.6;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-style: italic;
}

.qna-answer {
    background: #f8f9ff;
    padding: 1.25rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.qna-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.qna-difficulty {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
}

.qna-difficulty.easy,
.qna-difficulty.medium {
    background: #f1f5f9;
    color: #475569;
}

.qna-difficulty.hard {
    background: rgba(255, 107, 107, 0.1);
    color: var(--coral);
}

/* Priority styling based on difficulty */
.qna-item.hard::before {
    background: var(--coral);
}

.qna-item.medium::before {
    background: var(--primary);
}

.qna-item.easy::before {
    background: var(--primary);
}

.mark-reviewed-btn {
    background: var(--emerald);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mark-reviewed-btn:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

.mark-reviewed-btn:disabled {
    background: #94a3b8;
    color: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.9;
}

.mark-reviewed-btn.reviewed {
    background: #f1f5f9;
    color: var(--emerald);
}

/* Grey and unclickable after one click */
.mark-reviewed-btn.reviewed:disabled {
    background: #94a3b8;
    color: #e2e8f0;
    cursor: not-allowed;
    pointer-events: none;
}

.qna-item.reviewed {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
}

.qna-item.reviewed::before {
    background: var(--emerald);
}

.qna-item.reviewed .qna-question {
    opacity: 0.8;
}

.tips-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preparation-tips-card,
.progress-card,
.company-research-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.preparation-tips-card h4,
.progress-card h4,
.company-research-card h4 {
    color: #333;
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tips-toggle {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    justify-content: space-between;
}

.tips-toggle:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    padding: 0.5rem;
    margin: -0.5rem -0.5rem 1rem -0.5rem;
    border-radius: 8px;
}

.tips-toggle.collapsed {
    margin-bottom: 0;
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.tips-list {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.tips-list.collapsed {
    max-height: 0;
}

.preparation-tips-card ul,
.company-research-card ul {
    padding-left: 1.2rem;
}

.preparation-tips-card li,
.company-research-card li {
    color: #666;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.progress-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat {
    text-align: center;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 8px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.company-highlight {
    margin-bottom: 1rem;
}

.company-highlight strong {
    color: #333;
    font-size: 1.1rem;
}

/* Cold Messages Dropdown Styles */
.message-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    background: #ffffff;
    transition: box-shadow 0.2s ease;
}

.message-card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.message-header {
    user-select: none;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.message-header:hover {
    background-color: #f9fafb;
}

.message-header:hover .dropdown-arrow {
    color: #667eea;
}

.dropdown-arrow {
    transition: transform 0.3s ease, color 0.2s ease;
    font-size: 0.75rem;
}

.dropdown-arrow.rotated {
    transform: rotate(180deg);
}

.message-content-wrapper {
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    will-change: max-height, opacity;
}

.message-content-wrapper.collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    visibility: hidden;
    pointer-events: none;
}

.message-content-wrapper.expanded {
    max-height: 1000px !important;
    opacity: 1 !important;
    visibility: visible;
    pointer-events: auto;
    padding-top: 0.5rem;
    padding-bottom: 0;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Cold Messages Dropdown Component Styles */
.cold-messages-dropdown-container {
    width: 100%;
}

.cold-messages-dropdown-container .message-card {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

.cold-messages-dropdown-container .message-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cold-messages-dropdown-container .message-content-wrapper {
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Ensure smooth chevron rotation */
.cold-messages-dropdown-container .fa-chevron-down,
.cold-messages-dropdown-container .fa-chevron-up {
    transition: transform 0.3s ease;
}

/* Ensure message content is clickable and has proper spacing */
.cold-messages-dropdown-container .message-content,
.cold-messages-dropdown-container .cold-message-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

/* Mobile: tap-to-copy cold message – larger touch target, no tap delay */
@media (max-width: 768px) {
    .cold-messages-dropdown-container .cold-message-content {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

@media (max-width: 768px) {
    .interview-content {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding-top: 0 !important; /* Body already has padding-top for navbar; content sits exactly below */
    }
    
    .context-section {
        padding: 1rem;
    }
    
    .category-tabs-section {
        padding: 0.75rem 1rem;
        top: 48px;
    }
    
    .qa-list-section {
        padding: 1rem;
        padding-bottom: 6rem;
    }
    
    .analytics-section {
        padding: 1rem;
        padding-bottom: 2rem;
    }

    /* Removed header-content media query - header was replaced with teal navbar */
    /*
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    */

    .category-tabs {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        align-items: center;
    }

    .category-tab {
        min-width: auto;
    }

    .qna-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    /* Make Position and Company appear side-by-side on mobile (first two overview items) */
    .overview-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem; /* tighter spacing */
    }

    /* Ensure bookmark dropdown (or other full-width items) spans full width */
    .overview-content .bookmark-dropdown-wrapper,
    .overview-content .bookmark-dropdown-container {
        grid-column: 1 / -1;
    }
}

/* Mobile-specific Inter typography and visual tuning to match screenshot */
@media (max-width: 768px) {
    /* Use Inter font if loaded */
    .interview-content, .interview-content * {
        font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    }
    
    /* Ensure body uses white background on mobile */
    body {
        background: white;
    }
    
    /* Hide scrollbar on mobile */
    ::-webkit-scrollbar {
        display: none;
    }
    
    /* Context section mobile styling */
    .context-section {
        background: var(--slate-50);
    }
    
    /* Job selector mobile styling */
    .job-selector-display {
        font-size: 0.875rem;
        padding: 0.75rem;
    }
    
    /* Company intel button mobile styling */
    .company-intel-btn {
        font-size: 0.875rem;
    }
    
    /* Progress stats mobile styling */
    .progress-stat-card {
        padding: 0.75rem;
    }
    
    .progress-stat-card p {
        font-size: 0.625rem;
    }
    
    .progress-stat-card .text-2xl {
        font-size: 1.5rem;
    }

    /* Header */
    .job-overview-card h3 {
        font-weight: 800;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    /* Overview cards */
    .overview-item {
        padding: 0.6rem;
        border-radius: 10px;
        box-shadow: 0 6px 14px rgba(10,20,40,0.06);
    }
    .overview-item strong {
        font-weight: 700;
        font-size: 0.86rem;
    }
    .overview-item span {
        font-weight: 600;
        color: #4b5563;
        font-size: 0.96rem;
    }

    /* Tabs */
    .category-tabs { gap: 0.5rem; margin-bottom: 0.75rem; }
    .category-tab {
        padding: 0.6rem 0.9rem;
        border-radius: 10px;
        background: #f3f4f6;
        color: #374151;
        font-weight: 600;
        font-size: 0.95rem;
        flex: 0 0 auto;
        min-width: auto;
    }

    /* ensure tabs size to content and are centered in wrapped rows */
    .category-tab { flex: 0 0 auto; }
    .category-tab.active {
        background: #667eea;
        color: #fff;
    }

    /* Q&A answer card */
    .qna-answer {
        font-size: 0.875rem !important;
        background: #f1f5f9;
        border: 1px solid #e2e8f0;
        padding: 0.75rem;
        border-radius: 0.5rem;
        margin-top: 0.75rem;
        line-height: 1.5;
        font-style: italic;
        color: #475569;
    }
    .qna-question { 
        font-weight: 700; 
        font-size: 1rem; 
        color: #1e293b;
        line-height: 1.4;
    }
    
    /* Q&A item mobile styling */
    .qna-item {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Mark reviewed button mobile - tappable and clear reviewed state */
    .mark-reviewed-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        min-height: 2.5rem;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* Difficulty badge and button */
    .qna-difficulty { background: #dff3e8; color: #065f46; padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.75rem; }
    .mark-reviewed-btn { background: #10b981; color: #fff; padding: 0.45rem 0.8rem; border-radius: 8px; font-size: 0.95rem; }
    /* Mobile: grey and unclickable after one click */
    .mark-reviewed-btn:disabled,
    .mark-reviewed-btn.reviewed:disabled {
        background: #94a3b8 !important;
        color: #e2e8f0 !important;
        cursor: not-allowed !important;
        pointer-events: none !important;
        opacity: 0.9;
    }

    /* Tighter spacing adjustments */
    .overview-content { gap: 0.4rem; }
    .job-overview-card { padding-bottom: 0.7rem; margin-bottom: 0.4rem; }
    .qna-section { padding: 0 0.4rem; }

    /* Mobile accordion header tweaks (tighter) */
    .mobile-card-header {
        padding: 0.36rem 0.56rem;
        margin-bottom: 0.22rem;
    }
    .mobile-card-body { padding-top: 0.28rem; padding-bottom: 0.28rem; }
}

/* Remove large side gutters and vertical gap on mobile - make overview and categories tighter/full-width */
@media (max-width: 768px) {
    .interview-qna-container {
        padding-left: 2px !important;
        padding-right: 2px !important;
    }
    .interview-content {
        max-width: 100% !important;
        margin: 0 auto !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
        gap: 0.2rem !important;
    }
    .qna-container {
        width: 100% !important;
        margin: 0 !important;
        border-radius: 8px;
    }
    .job-overview-card {
        margin-bottom: 0.12rem !important;
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    .qna-categories {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
        margin-top: 0.08rem !important;
    }
}

@media (max-width: 768px) {
    /* When linkedin card is moved into overview, make it span full width and keep it tight with neighbors */
    .overview-content .linkedin-profiles-card.moved-linkedin {
        grid-column: 1 / -1;
        margin-top: 0.2rem;
        margin-bottom: 0.2rem;
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }
    /* When HR card is moved into overview, make it span full width and keep it tight with neighbors */
    .overview-content .hr-profiles-card.moved-hr {
        grid-column: 1 / -1;
        margin-top: 0.2rem;
        margin-bottom: 0.2rem;
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }
}

/* Mobile-only: hide progress card in Interview Prep to save vertical space */
@media (max-width: 768px) {
    .interview-qna-container .progress-card {
        display: none !important;
    }
}

/* Mobile accordion header styles for relocated cards */
@media (max-width: 768px) {
    .mobile-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 0.4rem 0.6rem; /* slightly tighter */
        border-radius: 6px;
        background: transparent;
        cursor: pointer;
        user-select: none;
        border-bottom: 1px solid rgba(0,0,0,0.04);
        margin-bottom: 0.25rem;
    }
    .mobile-card-title {
        font-weight: 700;
        color: #0f172a;
        font-size: 0.95rem;
    }
    .mobile-card-chevron {
        transition: transform 0.25s ease;
        color: #6b7280;
    }
    .mobile-card-body {
        display: none;
        padding-top: 0.3rem;
        padding-bottom: 0.3rem;
    }
    .mobile-accordion-enhanced.open .mobile-card-body {
        display: block;
    }

    /* Reduce spacing between overview and Q&A categories to keep content tighter */
    .job-overview-card {
        padding-bottom: 1rem; /* reduce bottom padding */
        margin-bottom: 0.5rem;
    }

    .qna-categories {
        padding: 1rem; /* reduce padding to hold tighter */
        margin-top: 0.25rem;
        gap: 0.5rem;
    }

    .qna-list {
        margin-top: 0.25rem;
    }
}

/* Desktop: show answers expanded and hide the chevron (accordion on mobile only) */
@media (min-width: 769px) {
    .qna-answer {
        display: block !important;
    }
    .qna-question .qna-toggle {
        display: none !important;
    }
}

/* Desktop: show answers expanded and hide the chevron (accordion on mobile only) */
@media (min-width: 769px) {
    .qna-answer {
        display: block !important;
    }
    .qna-question .qna-toggle {
        display: none !important;
    }
}

/* Desktop: show answers expanded and hide the chevron (accordion on mobile only) */
@media (min-width: 769px) {
    .qna-answer {
        display: block !important;
    }
    .qna-question .qna-toggle {
        display: none !important;
    }
}

/* Interview prep mobile: Mark as Reviewed → Reviewed, grey, unclickable after one tap */
@media (max-width: 768px) {
    .qna-item .mark-reviewed-btn:disabled,
    .qna-item .mark-reviewed-btn.reviewed:disabled,
    .mark-reviewed-btn:disabled,
    .mark-reviewed-btn.reviewed:disabled {
        background: #94a3b8 !important;
        color: #e2e8f0 !important;
        cursor: not-allowed !important;
        pointer-events: none !important;
        -webkit-tap-highlight-color: transparent;
        touch-action: none;
        opacity: 0.95;
    }
}