/* ===== GENERAL THEME BACKGROUNDS ===== */

/* Light mode base */
html[data-theme="light"] body {
    background-color: #f5f9fc;
    color: #2c3e50;
}

/* Dark mode base */
html[data-theme="dark"] body {
    background-color: #1c1f22;
    color: #e2e8f0;
}


/* ===== RECOMMENDATION CARD STYLES ===== */

.traditional-row {
    background: #ffffff;
    border: 1.5px solid #2c3e50;
    border-radius: 1rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.07);
    transition: box-shadow 0.3s, border-color 0.3s, background 0.3s;
}

/* Card styling for dark mode */
html[data-theme="dark"] .traditional-row {
    background: #263238;
    border-color: #81c784;
    box-shadow: 0 4px 18px rgba(129, 199, 132, 0.15);
}

/* Card hover effect */
.traditional-row:hover {
    border-color: #1e88e5;
    box-shadow: 0 8px 24px rgba(30, 136, 229, 0.18);
}


/* ===== CARD CONTENT ===== */

.traditional-info {
    padding: 2rem 2rem 2rem 3rem;
}


/* ===== CARD TYPOGRAPHY ===== */

/* Company name */
.company-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e3a5f;
    letter-spacing: 0.7px;
    margin-bottom: 0.3rem;
    font-family: 'Georgia', serif;
}

html[data-theme="dark"] .company-title {
    color: #bbdefb;
}

/* Date line */
.date-label {
    font-size: 0.95rem;
    color: #607d8b;
    margin-bottom: 0.8rem;
    font-style: italic;
}

html[data-theme="dark"] .date-label {
    color: #b0bec5;
}

/* Excerpt paragraph */
.excerpt {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #37474f;
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
}

html[data-theme="dark"] .excerpt {
    color: #eceff1;
}


/* ===== IMAGE STYLES ===== */

.preview-img {
    border-radius: 1rem 0 0 1rem;
    box-shadow: 0 6px 18px rgba(44, 62, 80, 0.12);
    cursor: pointer;
    border: 4px solid #1e88e5;
    transition: border-color 0.3s, transform 0.3s ease;
    max-width: 220px;
    height: 140px;
    object-fit: cover;
    background: #f0f4f8;
}

.preview-img:hover {
    border-color: #388e3c;
    transform: scale(1.05);
}

html[data-theme="dark"] .preview-img {
    border-color: #81c784;
    background: #263238;
}

/* ===== PREVIEW CONTAINER STYLES ===== */

.preview-container {
    position: relative;
    overflow: hidden;
    border-radius: 1rem 0 0 1rem;
}

.preview-overlay {
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-container:hover .preview-overlay {
    opacity: 1;
}

/* ===== PDF PREVIEW STYLES ===== */

.pdf-preview-container {
    border: 4px solid #1e88e5;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
    background: #f0f4f8;
    overflow: hidden;
}

.pdf-preview-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 136, 229, 0.18);
    border-color: #388e3c;
}

html[data-theme="dark"] .pdf-preview-container {
    border-color: #81c784;
    background: #263238;
}

html[data-theme="dark"] .pdf-preview-container:hover {
    box-shadow: 0 8px 24px rgba(129, 199, 132, 0.25);
}

.pdf-preview-container .preview-overlay {
    border-radius: inherit;
}

/* PDF Iframe Styling */
.pdf-iframe {
    border-radius: inherit;
    transition: opacity 0.3s ease;
}

/* Hide iframe scrollbars and interaction */
.pdf-preview-container iframe {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pdf-preview-container iframe::-webkit-scrollbar {
    display: none;
}

/* ===== UNSUPPORTED FILE STYLES ===== */

.unsupported-file {
    border: 4px solid #607d8b;
    background: #eceff1;
}

html[data-theme="dark"] .unsupported-file {
    border-color: #90a4ae;
    background: #37474f;
}

/* Fix dark mode text visibility in PDF object fallback */
html[data-theme="dark"] .pdf-preview-container .text-muted {
    color: #b0bec5 !important;
}

html[data-theme="dark"] .pdf-preview-container .text-danger {
    color: #ef5350 !important;
}


/* ===== RESPONSIVE MOBILE STYLES ===== */

@media (max-width: 767px) {
    .traditional-row {
        flex-direction: column !important;
        border-radius: 1rem;
    }

    .preview-img {
        border-radius: 0 0 1rem 1rem;
        margin: 1rem auto 0 auto;
        display: block;
    }

    .traditional-info {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
}


/* ===== THEME TOGGLE BUTTON (Legacy — likely unused now) ===== */

.theme-toggle-btn {
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    z-index: 9999;
    background: #e3f2fd;
    color: #1e3a5f;
    border: 2px solid #1e88e5;
    border-radius: 50px;
    padding: 0.5rem 1.1rem;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.08);
    cursor: pointer;
    transition: background 0.3s, color 0.3s, border 0.3s;
}

.theme-toggle-btn:hover {
    background: #1e88e5;
    color: #ffffff;
}

html[data-theme="dark"] .theme-toggle-btn {
    background: #263238;
    color: #bbdefb;
    border-color: #81c784;
}

html[data-theme="dark"] .theme-toggle-btn:hover {
    background: #81c784;
    color: #263238;
}


/* ===== MODAL STYLES ===== */

/* Darkened, blurred backdrop */
.modal-backdrop.show {
    background-color: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Modal card appearance */
.modal-content {
    border-radius: 1rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ffffffcc 0%, #f0f4f8cc 100%);
    border: none;
    transition: background 0.3s;
}

html[data-theme="dark"] .modal-content {
    background: linear-gradient(135deg, #263238dd 0%, #1c1f22ee 100%);
    box-shadow: 0 12px 40px rgba(129, 199, 132, 0.15);
}

/* Clean modal header/footer */
.modal-header,
.modal-footer {
    background: transparent;
    border: none;
}

/* Adjust close button visibility */
.modal-header .btn-close {
    filter: brightness(0) invert(0.3);
    transition: filter 0.3s ease;
}

.modal-header .btn-close:hover {
    filter: brightness(0) invert(0.7);
}

html[data-theme="dark"] .modal-header .btn-close {
    filter: brightness(0) invert(0.8);
}


/* ===== HOMEPAGE CARD DARK SUPPORT ===== */

.dark-card {
    background-color: #ffffff;
    border-radius: 1rem;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

html[data-theme="dark"] .dark-card {
    background-color: #263238;
    color: #e0f7fa;
}

html[data-theme="dark"] .dark-card .card-text {
    color: #b0bec5;
}

html[data-theme="dark"] .dark-card .card-title {
    color: #bbdefb;
}
