/* Variables */
:root {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --accent-color: #ef4444;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
    --background-color: #f3f4f6;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Responsive media */
img, video, svg, canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header and Navigation */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Search Container */
.search-container {
    position: relative;
    max-width: 600px;
    width: 100%;
    margin: 0 1rem;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

#search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#search-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    padding: 0.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

#search-button:hover {
    color: #2563eb;
}

/* Search Preview Styles */
#search-preview {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-suggestions {
    padding: 0.5rem 0;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.suggestion-item:hover {
    background-color: #f7fafc;
}

.suggestion-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.suggestion-text {
    flex-grow: 1;
    margin-right: 1rem;
}

.suggestion-highlight {
    color: #2563eb;
    font-weight: 600;
}

.suggestion-category {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: #e2e8f0;
    color: #475569;
    white-space: nowrap;
}

.suggestion-no-results {
    padding: 1rem;
    text-align: center;
    color: #64748b;
}

.show-all-item {
    border-top: 1px solid #e2e8f0;
    color: #2563eb;
    font-weight: 500;
}

.show-all-item:hover {
    background-color: #f8fafc;
}

/* Category-specific colors */
.suggestion-category[data-category="grammar"] {
    background-color: #dbeafe;
    color: #1e40af;
}

.suggestion-category[data-category="vocabulary"] {
    background-color: #dcfce7;
    color: #166534;
}

.suggestion-category[data-category="speaking"] {
    background-color: #fef3c7;
    color: #92400e;
}

.suggestion-category[data-category="writing"] {
    background-color: #fce7f3;
    color: #831843;
}

.suggestion-category[data-category="lesson-plans"] {
    background-color: #f3e8ff;
    color: #6b21a8;
}

.suggestion-category[data-category="worksheets"] {
    background-color: #ffedd5;
    color: #9a3412;
}

/* Mobile Responsive Styles - Consolidated */
@media (max-width: 768px) {
    /* Header and Navigation */
    header {
        padding: 0.5rem 0;
    }
    
    nav {
        padding: 0.5rem 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-links {
        flex-direction: row;
        justify-content: center;
        width: 100%;
        gap: 1rem;
        padding: 0.5rem 0;
    }

    /* Search Container */
    .search-container {
        width: 100%;
        margin: 0;
    }

    .search-input-button-container {
        width: 100%;
    }

    #search-input {
        width: 100%;
        max-width: none;
        font-size: 16px;
    }

    #search-input:focus {
        width: 100%;
    }

    /* Material Grid */
    .material-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }

    /* File Items */
    .file-item {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .file-content {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .file-name {
        font-size: 1rem;
        width: 100%;
        word-break: break-word;
        display: block;
    }

    .file-description {
        width: 100%;
        font-size: 0.9rem;
        display: block;
    }

    .button-container {
        flex-direction: row;
        justify-content: flex-start;
        width: 100%;
        gap: 0.5rem;
    }

    .details-button, .download-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        width: auto;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 5vh auto;
    }

    #pdf-preview-container {
        height: calc(90vh - 100px);
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    /* Navigation */
    nav {
        padding: 0.5rem;
    }

    .nav-links {
        flex-wrap: wrap;
    }

    .nav-links a {
        font-size: 0.9rem;
        padding: 0.3rem 0.5rem;
    }

    /* File Items */
    .file-item {
        padding: 0.75rem;
    }

    .button-container {
        flex-direction: column;
    }

    .details-button, .download-button {
        width: 100%;
        text-align: center;
    }

    /* Modal */
    .modal-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }

    #pdf-preview-container {
        height: calc(100vh - 60px);
    }

    .close-button {
        top: 0.5rem;
        right: 0.5rem;
    }

    .search-preview {
        max-height: 60vh;
    }
}

/* Very Small Mobile Devices */
@media (max-width: 390px) {
    .file-item {
        padding: 0.5rem;
    }

    .file-name {
        font-size: 0.9rem;
    }

    .file-description {
        font-size: 0.8rem;
    }

    .button-container {
        gap: 0.25rem;
    }

    .details-button, .download-button {
        padding: 0.4rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
}

/* Fix for iOS input zoom */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select,
    textarea,
    input {
        font-size: 16px !important;
    }
}

/* Improved touch targets for mobile */
@media (hover: none) and (pointer: coarse) {
    .nav-links a,
    .button-container button,
    .close-button,
    .file-name {
        padding: 0.75rem;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Main Content */
main {
    padding-top: 4rem;
    position: relative;
    z-index: 1;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 4rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    overflow-wrap: break-word;
    word-break: break-word;
}

.hero-text {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Teaching Materials Section */
.materials-overview {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
    background-color: var(--background-color);
    border-radius: 12px;
}

.materials-overview h2 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.section-description {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.material-box {
    background-color: var(--white);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.material-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.material-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.material-box h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    overflow-wrap: break-word;
    word-break: break-word;
}

.material-box p {
    color: var(--text-light);
    font-size: 0.95rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* About Section */
.about {
    background: linear-gradient(to bottom, var(--background-color), var(--white));
    padding: 6rem 2rem;
    position: relative;
    overflow: hidden;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(37, 99, 235, 0.2), transparent);
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
    background: var(--white);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: relative;
}

.about h2 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    font-weight: 700;
}

.about h2::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

.about p {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 2rem auto;
    position: relative;
    padding: 0 1rem;
}

.about .author-section {
    margin: 3rem auto;
    padding: 2rem;
    background: linear-gradient(to right bottom, var(--white), var(--background-color));
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
    max-width: 600px;
}

.about .author-section h3 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.about .author-bio {
    color: var(--text-color);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.linkedin-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background-color: #0077b5;
    color: var(--white);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 119, 181, 0.3);
}

.linkedin-button i {
    font-size: 1.2rem;
}

.linkedin-button:hover {
    background-color: #005885;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 119, 181, 0.4);
}

@media (max-width: 768px) {
    .about .author-section {
        margin: 2rem auto;
        padding: 1.5rem;
    }

    .about .author-section h3 {
        font-size: 1.3rem;
    }

    .about .author-bio {
        font-size: 1rem;
        line-height: 1.6;
    }

    .linkedin-button {
        padding: 0.6rem 1.25rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .about .author-section {
        margin: 1.5rem auto;
        padding: 1.25rem;
    }

    .about .author-section h3 {
        font-size: 1.2rem;
    }

    .about .author-bio {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }

    .linkedin-button {
        width: 100%;
        justify-content: center;
    }
}

.features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 3rem 0 2rem;
}

.feature {
    background: linear-gradient(to bottom right, var(--white), var(--background-color));
    padding: 1.5rem 2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 220px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.feature:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.1);
}

.feature i {
    font-size: 1.5rem;
    color: var(--primary-color);
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.feature span {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

/* Mobile Responsive Updates */
@media (max-width: 768px) {
    .file-item {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .button-container {
        width: 100%;
        justify-content: flex-start;
    }

    .about {
        padding: 4rem 1.5rem;
    }

    .about-content {
        padding: 2rem 1.5rem;
    }

    .about h2 {
        font-size: 2rem;
    }

    .about p {
        font-size: 1rem;
        line-height: 1.6;
        margin: 1.5rem auto;
    }

    .features {
        gap: 1rem;
        margin: 2rem 0;
    }

    .feature {
        padding: 1.25rem 1.5rem;
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .file-item {
        padding: 0.875rem;
    }

    .button-container {
        flex-direction: row;
        justify-content: space-between;
    }

    .details-button, .download-button {
        flex: 1;
        max-width: 48%;
        min-width: 0;
    }

    .about-content {
        padding: 1.5rem 1rem;
    }

    .about h2 {
        font-size: 1.75rem;
    }

    .about p {
        font-size: 0.95rem;
        padding: 0;
        margin: 1.25rem auto;
    }

    .feature {
        width: 100%;
        justify-content: center;
    }

    .feature span {
        font-size: 1rem;
    }
}

/* Footer */
footer {
    background-color: var(--white);
    padding: 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* Buttons */
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--white);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
    border: 2px solid var(--white);
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 5;
}

.cta-button:hover {
    background-color: transparent;
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.cta-button i {
    font-size: 1.2rem;
}

/* Specific styles for the refresh button */
#refresh-button {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#refresh-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: transparent;
}

#refresh-button:hover i {
    animation: refresh-spin 0.6s ease;
}

#refresh-button:active {
    transform: scale(0.97);
}

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content,
.material-box,
.about-content {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Materials page styles */
.materials-page {
    padding-top: 80px;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
    position: relative;
    z-index: 1;
}

.page-header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.page-header .section-description {
    color: var(--white);
    opacity: 0.9;
    margin-bottom: 0;
}

.refresh-section {
    margin-top: 2rem;
}

/* Collapsible section styles with higher specificity */
body .material-section {
    background-color: var(--white);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

body .section-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--white);
    cursor: pointer;
    position: relative;
    z-index: 2;
    border-radius: 8px 8px 0 0;
}

body .section-header i {
    margin-right: 1rem;
    font-size: 1.5rem;
    color: var(--white);
}

body .section-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
}

body .section-header .toggle-icon {
    position: absolute;
    right: 1.5rem;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    color: var(--white);
}

body .material-section.collapsed .toggle-icon {
    transform: rotate(-90deg) !important;
}

body .files-container {
    max-height: 500px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    width: 100% !important;
    padding: 1rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.8rem !important;
    background-color: var(--background-color);
    border-radius: 0 0 8px 8px;
}

body .material-section.collapsed .files-container {
    max-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    margin: 0 !important;
    border: none !important;
    height: 0 !important;
    display: none !important;
}

/* File Item Styles - Added Hover Cursor */
.file-item {
    background: var(--white);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    box-sizing: border-box;
    cursor: pointer;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

/* Add subtle alternating background colors for adjacent items with similar names */
.file-item:nth-child(odd) {
    background-color: var(--background-color);
}

.file-item:nth-child(even) {
    background-color: rgba(243, 244, 246, 0.5);
}

.file-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0; /* Ensures text truncation works */
}

.file-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.button-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

.details-button, .download-button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: var(--transition);
    min-height: 36px;
    border: 1px solid;
    min-width: 120px;
    max-width: 160px;
}

.details-button i, .download-button i {
    font-size: 0.875rem;
}

/* Style overrides for material items to ensure full visibility of file names */
.file-item .file-content {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.file-item .file-content .file-name {
    width: 100%;
    max-width: 100%;
    display: block;
    word-break: break-word;
    word-wrap: break-word;
    white-space: normal;
    overflow: hidden;
    padding-right: 5px;
}

/* Search Result Highlighting */
.file-item.search-match {
    background-color: rgba(37, 99, 235, 0.05);
    border: 1px solid var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.15);
    position: relative;
}

.search-match .file-name {
    font-weight: 600;
    color: var(--primary-color);
}

.search-highlight {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--text-color);
    font-weight: 600;
    padding: 0 2px;
    border-radius: 3px;
    box-shadow: none;
    position: relative;
    display: inline-block;
}

.search-results-summary {
    background-color: var(--white);
    padding: 0.8rem 1.5rem;
    margin: 1rem 0 1.5rem 0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.search-results-summary .count {
    font-weight: 600;
    color: var(--primary-color);
}

.clear-search {
    background-color: var(--white);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.clear-search:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.has-search-results .section-header {
    background-color: var(--primary-color);
    position: relative;
}

.has-search-results .section-header::after {
    content: "Contains matches";
    position: absolute;
    right: 3rem;
    font-size: 0.8rem;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
}

.no-results-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-style: italic;
    background-color: var(--white);
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Style for the selected search result */
.file-item.search-selected {
    background-color: rgba(37, 99, 235, 0.08);
    border: 1px solid var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.15);
    position: relative;
}

.file-item.search-selected::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--primary-color);
}

/* Search loading indicator */
.search-loading {
    text-align: center;
    padding: 12px 15px;
    background-color: var(--white);
    border-radius: 8px;
    margin: 10px 0;
    font-style: italic;
    color: var(--text-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.search-loading i {
    color: var(--primary-color);
    font-size: 1rem;
    animation: spin 1s linear infinite;
}

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

/* Update level-based styling for file items */
.file-item[data-level="Beginner"] {
    border-left: 4px solid #4CAF50;
}

.file-item[data-level="Intermediate"] {
    border-left: 4px solid #FFC107;
}

.file-item[data-level="Advanced"] {
    border-left: 4px solid #F44336;
}

/* Hover effects for each level */
.file-item[data-level="Beginner"]:hover {
    border-left: 4px solid #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

.file-item[data-level="Intermediate"]:hover {
    border-left: 4px solid #FFC107;
    background-color: rgba(255, 193, 7, 0.1);
}

.file-item[data-level="Advanced"]:hover {
    border-left: 4px solid #F44336;
    background-color: rgba(244, 67, 54, 0.1);
}

/* Remove the old A1-C2 level styling */
.file-item[data-level^="A1"],
.file-item[data-level^="A2"],
.file-item[data-level^="B1"],
.file-item[data-level^="B2"],
.file-item[data-level^="C1"],
.file-item[data-level^="C2"] {
    border-left: none;
}

.file-item[data-level^="A1"]:hover,
.file-item[data-level^="A2"]:hover,
.file-item[data-level^="B1"]:hover,
.file-item[data-level^="B2"]:hover,
.file-item[data-level^="C1"]:hover,
.file-item[data-level^="C2"]:hover {
    border-left: none;
    background-color: var(--hover-color);
}

.pdf-container {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#pdf-canvas {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.pdf-loading {
    text-align: center;
    padding: 2rem;
    width: 100%;
}

.pdf-loading i {
    font-size: 2rem;
    color: #4285f4;
    margin-bottom: 1rem;
}

.pdf-loading p {
    margin: 0;
    color: var(--text-color);
    font-weight: 500;
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    overflow: hidden;
}

.modal-content {
    position: relative;
    background: var(--white);
    margin: 2vh auto;
    padding: 1.5rem;
    width: 90%;
    max-width: 1200px;
    height: 96vh;
    border-radius: 12px;
    overflow: hidden;
}

.close-button {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    color: var(--text-color);
    background: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 2001;
}

#pdf-preview-container {
    width: 100%;
    height: calc(96vh - 60px);
    overflow: auto;
    background: #f5f5f5;
    border-radius: 8px;
}

/* Loading and error states */
.loading, .error {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

.error {
    color: var(--accent-color);
}

/* Material Detail Page Styles */
.material-detail-page {
    padding-top: 6rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem;
}

.back-button {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    background-color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--primary-color);
}

.back-link i {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.back-link:hover {
    color: var(--white);
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.back-link:hover i {
    transform: translateX(-3px);
}

.material-container {
    background-color: var(--white);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.material-info {
    margin-bottom: 2rem;
}

.material-info h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.material-metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    background-color: var(--background-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metadata-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.metadata-item p {
    margin: 0;
    color: var(--text-light);
}

.metadata-item span {
    color: var(--text-color);
    font-weight: 500;
    display: block;
    margin-top: 0.25rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

/* Keep the improved styling for search elements */

/* Button container styles */
.button-container {
    display: flex;
    gap: 10px;
    min-width: 55px;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 1;
}

.details-button, .preview-button, .download-button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.details-button {
    background-color: var(--white);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.details-button:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.download-button {
    background-color: var(--white);
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
}

.download-button:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* Materials Page Specific Styles */
.materials-hero {
    background: linear-gradient(rgba(37, 99, 235, 0.9), rgba(59, 130, 246, 0.9));
    color: var(--white);
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    border-radius: 8px;
}

.materials-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
    overflow-wrap: break-word;
    word-break: break-word;
}

.materials-hero .hero-text {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    color: var(--white);
    overflow-wrap: break-word;
    word-break: break-word;
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.material-section {
    margin-bottom: 2rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.section-header {
    padding: 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
}

.section-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header .toggle-icon {
    transition: transform 0.3s ease;
}

.material-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.files-container {
    padding: 1.5rem;
    background-color: var(--white);
}

.files-container article {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.files-container article:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.files-container article h4 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.files-container article p {
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.files-container article p:last-child {
    margin-bottom: 0;
}

.files-container article a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.files-container article a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Responsive improvements for files container */
@media (max-width: 768px) {
    .files-container {
        padding: 1rem;
    }

    .files-container article {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .files-container article h4 {
        font-size: 1rem;
        line-height: 1.4;
        word-break: break-word;
    }

    .files-container article p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .files-container article a {
        font-size: 0.9rem;
        padding: 0.5rem 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .files-container {
        padding: 0.75rem;
    }

    .files-container article {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .files-container article h4 {
        font-size: 0.95rem;
    }

    .files-container article p {
        font-size: 0.85rem;
    }
}

/* Material section improvements */
.material-section {
    margin-bottom: 2rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.section-header {
    padding: 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
}

.section-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header .toggle-icon {
    transition: transform 0.3s ease;
}

.material-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

/* --- Add secondary button style --- */
.secondary-button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #fff;
    color: #2563eb;
    border: 2px solid #2563eb;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(37,99,235,0.05);
    margin-top: 1.5rem;
}
.secondary-button:hover {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 4px 16px rgba(37,99,235,0.12);
}

/* --- About page improvements --- */
.about-hero {
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    padding: 3rem 0 2rem 0;
    text-align: center;
}
.about-hero .hero-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.about-hero .hero-content .hero-text {
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 0;
}

.about-content {
    background: #f7f8fa;
    padding: 3rem 0 2rem 0;
}
.about-content .container {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(37,99,235,0.07);
    padding: 2.5rem 2rem;
}
.about-content .about-text h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #2563eb;
}
.about-content .about-text p {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 1.2rem;
}
.about-content .features {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}
.about-content .feature {
    background: #f1f5ff;
    border-radius: 10px;
    padding: 1.2rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.1rem;
    color: #2563eb;
    font-weight: 600;
    box-shadow: 0 1px 6px rgba(37,99,235,0.06);
}
.about-content .feature i {
    font-size: 1.3rem;
}

/* Home about section button alignment */
.cta-container {
    text-align: center;
    margin-top: 2rem;
}

.file-item.level-beginner {
    border-left: 4px solid #34d399 !important;
    background: #f0fdf4 !important;
}
.file-item.level-intermediate {
    border-left: 4px solid #60a5fa !important;
    background: #eff6ff !important;
}
.file-item.level-advanced {
    border-left: 4px solid #f59e42 !important;
    background: #fff7ed !important;
}

/* Styles for the centered list in "What We Offer" section */
.offer-list-container {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    margin-bottom: 1.2rem;
}

.offer-list-container ul {
    list-style-position: outside;
    text-align: left;
    padding-left: 0;
}

.offer-list-container ul li {
    margin-bottom: 0.5rem;
}

/* Team CTA Section */
.team-cta {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.author-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.author-section h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: #2563eb;
}

.author-bio {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #333;
}

.linkedin-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #0077b5;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.linkedin-button:hover {
    background: #005885;
}

.linkedin-button i {
    font-size: 1.2rem;
}
