/* Materials Page Specific Styles */
:root {
    --primary-color: #333;
    --accent-color: #4ade80;
    --bg-color: #f0f2f5;
    --text-color: #333;
    --header-bg: #fff;
    --sidebar-bg: #2eac62;
    --sidebar-text: #ecf0f1;
    --content-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --hero-bg: #f8fafc;
    --card-bg: #ffffff;
    --testimonial-bg: #f8fafc;
    --footer-bg: #2c3e50;
    --footer-text: #ffffff;
    --border-color: #e2e8f0;
    --gray: #f1f5f9;
    --gray-dark: #e2e8f0;
    --text-light: #64748b;
    --primary-light: #e0f2fe;
    --danger: #ef4444;
    --white: #ffffff;
    --border-radius: 0.5rem;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --primary-color: #e2e8f0;
    --accent-color: #4ade80;
    --bg-color: #1a202c;
    --text-color: #e2e8f0;
    --header-bg: #2d3748;
    --sidebar-bg: #1a202c;
    --sidebar-text: #e2e8f0;
    --content-bg: #2d3748;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --hero-bg: #1a202c;
    --card-bg: #2d3748;
    --testimonial-bg: #2d3748;
    --footer-bg: #1a202c;
    --footer-text: #e2e8f0;
    --border-color: #4a5568;
    --gray: #2d3748;
    --gray-dark: #4a5568;
    --text-light: #a0aec0;
    --primary-light: #2d3748;
    --white: #2d3748;
}

/* Header styles */
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px var(--shadow-color);
    
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo span {
    color: var(--accent-color);
}

#mainNav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 2rem;
}

#mainNav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

#mainNav a:hover {
    color: var(--accent-color);
}

.logo span {
    color: var(--accent-color);
}

.logo:hover {
    color: var(--accent-color);
}

/* Navigation styles */

#mainNav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

#mainNav a:hover::after {
    width: 100%;
}


.dark-mode-toggle {
    position: relative;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle svg {
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease;
    fill: var(--text-color);
}

.dark-mode-toggle .light-icon {
    opacity: 0;
}

[data-theme="dark"] .dark-mode-toggle .dark-icon {
    opacity: 0;
}

[data-theme="dark"] .dark-mode-toggle .light-icon {
    opacity: 1;
}

/* Materials Page Specific Styles */
.study-materials {
    padding: 100px 0;
    background-color: var(--bg-color);
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.material-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.material-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.material-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.material-content {
    padding: 20px;
}

.material-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.material-content p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.view-more {
    text-align: center;
    margin-top: 50px;
}

.materials-main {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-color);
    line-height: 1.5;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    margin-bottom: 0px;
    background-color: var(--bg-color);
}

.materials-header {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.materials-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    line-height: 1.2;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* ----------------- --------------------------*/
/*-------------------Search Form------------------------*/
/* ----------------- --------------------------*/

.search-form {
    max-width: 900px;
    margin: 0 auto;
}

.search-input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input {
    width: 74%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 1px solid var(--gray-dark);
    border-radius: var(--border-radius);
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    padding-right: 3.5rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}

.search-button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 3.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ----------------- --------------------------*/
/*----------------Filter Controls-----------------------------*/
/* ----------------- --------------------------*/

.search-filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.filter-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.filter-select {
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid var(--gray-dark);
    border-radius: var(--border-radius);
    background-color: var(--white);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
}

/* ----------------- --------------------------*/
/*------------------------Materials Grid-------------------------------------*/
/* ----------------- --------------------------*/

.study-materials{
    padding-top: 0;
}
.material-card:hover .material-image {
    transform: scale(1.03);
}

.material-image-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.material-image-placeholder svg {
    width: 3rem;
    height: 3rem;
    color: var(--gray-dark);
}

.resource-type-badge {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.material-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.material-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.material-category, .material-grade {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    display: inline-block;
}

.material-category {
    background-color: var(--primary-light);
    color: var(--accent-color);
}

.material-grade {
    background-color: #e6f7ff;
    color: #1890ff;
}

.material-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: var(--text-color);
}

.material-description {
    color: var(--text-light);
    margin: 0 0 1.5rem 0;
    flex-grow: 1;
}

.material-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.material-date {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.view-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-button:hover {
    background-color: var(--primary-color);
    transform: translateY(-1px);
}

.view-button svg {
    width: 1rem;
    height: 1rem;
}

/* Search Results Info Styles */
.search-results-info {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.active-filter {
    background-color: var(--primary-light);
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.remove-filter {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

.remove-filter:hover {
    color: var(--danger);
}

.clear-search {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.clear-search:hover {
    text-decoration: underline;
}

/* Empty State Styles */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state-icon {
    margin-bottom: 1.5rem;
}

.empty-state-icon svg {
    width: 4rem;
    height: 4rem;
    color: var(--gray-dark);
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Header Container Styles */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    #mainNav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--header-bg);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 2px 10px var(--shadow-color);
    }
    
    #mainNav.active ul {
        display: flex;
    }
}

/* Chat Button Styles */
.chat-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--accent-color);
    color: white;
    padding: 1rem;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    z-index: 1000;
}

.chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.chat-btn i {
    font-size: 1.25rem;
}

.chat-label {
    font-weight: 500;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .chat-btn {
        padding: 0.75rem;
    }
    
    .chat-label {
        display: none;
    }
}

/* Footer Styles */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 40px 20px;
    position: relative;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-column h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    position: relative;
    color: var(--footer-text);
}

.footer-column h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background-color: var(--accent-color);
    margin-top: 10px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--footer-text);
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.3s;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    color: var(--footer-text);
    font-size: 1rem;
    opacity: 0.8;
    transition: all 0.3s;
}

.social-links a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
    color: var(--footer-text);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .materials-main {
        padding: 1.5rem 1rem;
        padding-top: 20px;
    }

    .materials-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .materials-header h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }
}
