/* Custom styles to supplement Bootstrap */

/* Navbar Styling */
.navbar {
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-weight: 500;
    color: var(--text-primary) !important;
}

.nav-link {
    position: relative;
    padding: 0.5rem 0.7rem;
    transition: color 0.2s ease;
    color: var(--text-nav) !important;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--text-nav-active) !important;
    font-weight: 500;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.navbar-nav .dropdown-menu {
    border: none;
    box-shadow: var(--dropdown-shadow);
    border-radius: 0.5rem;
    padding: 0.5rem;
    background-color: var(--background-card);
}

.dropdown-item {
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    transition: background-color 0.2s ease;
    color: var(--text-primary);
}

.dropdown-item:hover {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.dropdown-item-text {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
}

/* Theme Toggle Button */
#theme-toggle {
    color: var(--text-nav);
    background: transparent;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#theme-toggle:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

.resume-content {
    font-family: 'Calibri', 'Arial', sans-serif;
    white-space: pre-wrap;
    max-height: 600px;
    overflow-y: auto;
    background-color: var(--resume-preview-bg, white);
    color: var(--resume-preview-text, black);
    padding: 1.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color, #dee2e6);
    box-shadow: var(--box-shadow, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075));
    line-height: 1.2;
}

.resume-preview-container {
    background-color: var(--background-card, white);
    border-radius: 0.25rem;
    border: 1px solid var(--border-color, #dee2e6);
    box-shadow: var(--box-shadow, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075));
    margin-bottom: 1.5rem;
}

.reference-resume-container {
    background-color: var(--background-card, #2d2d2d);
    color: var(--text-primary, #ffffff);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color, #2d2d2d);
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow, 0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Resume Preview Styling - for formatted HTML version */
.resume-preview {
    font-family: 'Calibri', 'Arial', sans-serif;
    max-height: 600px;
    overflow-y: auto;
    background-color: var(--resume-preview-bg, #1e1e1e);
    color: var(--resume-preview-text, #ffffff);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color, #2d2d2d);
    box-shadow: var(--box-shadow, 0 4px 6px rgba(0, 0, 0, 0.1));
    line-height: 1.4;
    margin: 0;
}

/* Resume Header Styling */
.resume-header {
    margin-bottom: 15px;
    text-align: left;
}

.resume-name {
    font-size: 16pt;
    font-weight: bold;
    margin-bottom: 3px;
    color: #000;
}

.resume-contact {
    font-size: 10pt;
    margin-bottom: 2px;
}

.resume-location {
    font-size: 10pt;
    margin-bottom: 15px;
}

/* Resume Section Styling */
.section-header {
    font-weight: bold;
    font-size: 12pt;
    margin-top: 15px;
    margin-bottom: 8px;
    text-transform: uppercase;
    color: #ffffff;
}

/* Section content styling */
.section-content {
    margin-bottom: 15px;
}

.section-content p {
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Resume Content Lists */
.resume-preview ul, .resume-content ul {
    padding-left: 20px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.resume-preview li, .resume-content li {
    margin-bottom: 4px;
    line-height: 1.4;
}

/* Nested Skills Lists */
.resume-content .skills-list {
    margin-top: 4px;
    margin-bottom: 12px;
    padding-left: 20px;
    list-style-type: disc;
}

.resume-content .nested-skill-list {
    margin-top: 2px;
    margin-bottom: 2px;
    padding-left: 20px;
    list-style-type: circle;
}

.resume-content .skill-item {
    margin-bottom: 2px;
}

/* Fix for reference resume view on dashboard */
#referenceResumeCollapse .resume-content {
    padding: 1.5rem;
    margin: 0;
    max-height: 400px;
    background-color: white;
    color: black;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

#referenceResumeCollapse .section-header {
    color: #000; 
    margin-top: 12px;
    margin-bottom: 8px;
}

#referenceResumeCollapse .skills-category {
    margin-top: 8px;
    margin-bottom: 4px;
}

/* Skills Categories */
.skills-category {
    font-weight: bold;
    font-size: 11pt;
    margin-top: 8px;
    margin-bottom: 4px;
}

/* Company Headers */
.company-header {
    font-weight: bold;
    font-size: 11pt;
    margin-top: 10px;
    margin-bottom: 5px;
}

.card {
    margin-bottom: 1rem;
    background-color: var(--background-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
}

/* Dark mode specific card styling */
[data-bs-theme="dark"] .card.bg-white {
    background-color: var(--background-card) !important;
    color: var(--text-primary) !important;
}

/* Dark mode specific text colors */
[data-bs-theme="dark"] .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Dark mode specific background colors */
[data-bs-theme="dark"] .bg-light {
    background-color: var(--background-muted) !important;
}

/* Dark mode specific heading colors */
[data-bs-theme="dark"] .display-5,
[data-bs-theme="dark"] .lead {
    color: var(--text-primary) !important;
}

/* Dark mode alert styling */
[data-bs-theme="dark"] .alert-success {
    background-color: rgba(45, 198, 83, 0.2) !important;
    border-color: rgba(45, 198, 83, 0.3) !important;
    color: var(--text-primary) !important;
}

.alert {
    margin-bottom: 1rem;
}

/* Theme transition effects */
.theme-transition {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Progress indicator styles */
.progress-indicator {
    height: 4px;
    width: 100%;
    background-color: var(--bs-primary);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: width 0.3s ease-in-out;
}

/* Processing overlay styling */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
}

.processing-content {
    background-color: var(--background-card);
    padding: 2.5rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: var(--modal-shadow);
}

.processing-content h4 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1rem;
    color: var(--text-primary);
}

.processing-content .progress {
    height: 0.8rem;
    background-color: var(--background-muted);
    margin-bottom: 1.5rem;
}

.processing-content .progress-bar {
    background-color: var(--primary-color);
    transition: width 0.5s ease;
}

.processing-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Improve table responsiveness on mobile */
    .table-responsive {
        font-size: 0.9rem;
    }
    
    /* Make buttons and card elements more touch-friendly */
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    /* Increase button size for touch targets */
    .btn-icon {
        min-width: 42px;
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Make feather icons larger and more visible on mobile */
    .feather {
        width: 20px;
        height: 20px;
        stroke-width: 2;
    }
    
    /* Increase font size for better readability */
    .card-title {
        font-size: 1.25rem;
    }
    
    .card-text {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    /* Make badges more readable */
    .badge {
        font-size: 0.85rem !important;
        padding: 0.4rem 0.6rem !important;
    }
    
    /* Improve form control visibility */
    .form-control {
        font-size: 1rem;
        padding: 0.6rem 0.75rem;
        height: auto;
    }
    
    /* Processing overlay improvements */
    .processing-content {
        padding: 1rem;
        width: 95%;
    }
    
    /* Group buttons better on mobile */
    .btn-group {
        display: flex;
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .btn-group .btn {
        flex: 1;
    }
    
    /* Better navigation on mobile */
    .navbar-collapse {
        margin-top: 1rem;
        padding: 1rem 0;
        border-top: 1px solid var(--border-color);
    }
    
    /* Add more space between nav items on mobile */
    .navbar-nav .nav-item {
        margin-bottom: 0.75rem;
    }
    
    /* Make nav links more tappable */
    .navbar-nav .nav-link {
        padding: 0.75rem 0.5rem;
        font-size: 1.1rem;
    }
    
    /* Make primary actions more prominent on mobile */
    .mobile-primary-action {
        width: 100%;
        margin: 0.75rem 0;
        padding: 0.85rem 1rem;
        font-weight: 600;
        font-size: 1.1rem;
    }
    
    /* Improve dropdown readability on mobile */
    .dropdown-menu {
        border: 1px solid var(--border-color);
        box-shadow: var(--dropdown-shadow);
        width: 100%;
        min-width: 100%;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    /* Improve modal usability on mobile */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Resume preview sizing on mobile */
    #resumePreviewModal .resume-preview {
        padding: 1rem;
        max-height: 70vh;
    }
    
    /* Stack button groups vertically on mobile */
    .card-footer .btn-group {
        flex-direction: column;
    }
    
    .card-footer .btn-group .btn {
        border-radius: 0.25rem !important;
        margin-bottom: 0.5rem;
    }
    
    /* Adjust card layouts on mobile */
    .card-deck {
        display: block;
    }
    
    .card-deck .card {
        margin-bottom: 1rem;
    }
}

/* Custom button hover effects */
.btn {
    transition: transform 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Accessibility classes */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* File upload area styling */
.custom-file-upload {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.custom-file-upload:hover {
    border-color: var(--bs-primary);
}

/* Improved navbar spacing */
.navbar-nav {
    display: flex;
    gap: 0.25rem;
}

.navbar .navbar-nav .nav-item.mx-1 {
    margin-left: 0.25rem !important;
    margin-right: 0.25rem !important;
}

/* Ensure icons are properly aligned in nav items */
.navbar .nav-link svg {
    vertical-align: -0.125em;
    margin-right: 0.25rem;
}

/* Add a subtle separator between main nav sections */
.navbar-nav:after {
    content: '';
    display: block;
    margin: 0 0.5rem;
}

/* Job Analysis Dropdown Styling */
.job-analysis-dropdown {
    min-width: 280px;
    width: 300px;
    max-width: 90vw;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: var(--background-card);
}

.job-analysis-dropdown .dropdown-header {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.job-analysis-dropdown ul {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.job-analysis-dropdown li {
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

.job-analysis-dropdown .badge {
    font-size: 0.875rem;
    padding: 0.35rem 0.65rem;
}

[data-bs-theme="dark"] .job-analysis-dropdown {
    background-color: var(--background-card);
    border: 1px solid var(--border-color);
}

[data-bs-theme="dark"] .job-analysis-dropdown .dropdown-header {
    color: var(--text-primary);
}

[data-bs-theme="dark"] .job-analysis-dropdown li {
    color: var(--text-secondary);
}

/* Resume Preview Modal Styling */
#resumePreviewModal .modal-dialog {
    max-width: 800px;
}

#resumePreviewModal .modal-content {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--background-card);
}

#resumePreviewModal .modal-header {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-muted);
}

#resumePreviewModal .modal-body {
    padding: 1.5rem;
}

#resumePreviewModal .resume-preview {
    background-color: white;
    color: black;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
    font-family: 'Calibri', Arial, sans-serif;
    line-height: 1.4;
}

/* Resume preview content styling */
#resumePreviewModal .resume-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

#resumePreviewModal .resume-name {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

#resumePreviewModal .resume-contact {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

#resumePreviewModal .resume-location {
    font-size: 0.9rem;
}

#resumePreviewModal .section-header {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.25rem;
}

#resumePreviewModal .section-content {
    margin-bottom: 1rem;
}

#resumePreviewModal .skills-category {
    margin-top: 0.75rem;
    font-weight: 500;
}

#resumePreviewModal .company-header {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

#resumePreviewModal ul {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

#resumePreviewModal li {
    margin-bottom: 0.25rem;
}

[data-bs-theme="dark"] #resumePreviewModal .resume-preview {
    background-color: white;
    color: black;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

#resumePreviewModal .badge {
    font-size: 0.875rem;
    padding: 0.35rem 0.65rem;
}

/* Improved icon sizing for all screen sizes */
.feather {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
    vertical-align: -0.125em;
}

/* Better action button spacing */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Enhanced button groups for touch interfaces */
.btn-group-touch {
    display: flex;
    gap: 0.25rem;
}

/* Additional responsive improvements */
@media (max-width: 576px) {
    /* Make dashboard cards full-width on small screens */
    .col-md-6, .col-md-4 {
        width: 100%;
    }
    
    /* Ensure buttons don't get too small on mobile */
    .btn-sm {
        padding: 0.4rem 0.65rem;
        font-size: 0.9rem;
    }
    
    /* Expand dropdown menus to full width on small screens */
    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 80vh;
        overflow-y: auto;
        margin: 0;
        padding: 1rem;
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 1050;
    }
    
    .dropdown-menu.show {
        transform: translateY(0);
    }
    
    /* Improve mobile table display */
    .table-responsive {
        margin-bottom: 1.5rem;
    }
    
    .table-responsive table {
        min-width: 500px;
    }
}
