:root {
    --light-color: #f5f7fa;
    --dark-color: #263238;
    --success-color: #00c853;
    --text-color: #455a64;
    --sidebar-bg: #171b26;
    --sidebar-border: #232537;
    --sidebar-text: #ccd6f6;
    --primary-color: #1a202c;
    --secondary-color: #2d3748;
    --accent-color: #4299e1;
    --hover-color: #4a5568;
    --card-bg: #f7fafc;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --modal-bg: rgba(0, 0, 0, 0.7);
    --scrollbar-bg: #f1f1f1;
    --scrollbar-thumb: #888;
    --scrollbar-thumb-hover: #555;
    --close-btn-bg: #f1f5f9;
    --close-btn-hover: #e2e8f0;
    --hover-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    --gradient-primary: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    --gradient-accent: linear-gradient(135deg, #00acc1 0%, #0097a7 100%);
    --gradient-success: linear-gradient(135deg, #00c853 0%, #00a040 100%);
}

body {
    display: flex;
    min-height: 100vh;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    padding: 30px;
    margin-left: 280px;
    overflow-y: auto;
    transition: margin-left 0.3s ease;
}

/* header section */
header {
    text-align: center;
    margin-bottom: 35px;
    padding: 14px 16px;
    background-color: #2d3748;
    border-radius: 12px;
    color: white;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

header::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 250px;
    height: 250px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

/* Resource Categories */
.resource-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.category-btn {
    height: 40px;
    border-radius: 20px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0 1.2rem;
    min-width: 80px;
}

.category-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

.category-btn.active {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 153, 225, 0.3);
}

/* Resource Cards */
.resources-grid {
    display: grid;
    /* grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem; */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 2rem;
}

.resource-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 1rem;
    background: #2d3748;
    color: white;
}

.card-header h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.card-header .category {
    font-size: 0.8rem;
    color: #a0aec0;
}

.card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-body p {
    margin-bottom: 1rem;
    color: #4a5568;
    text-align: center;
}

.card-footer {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
}

.tag {
    padding: 0.25rem 0.5rem;
    background-color: #e2e8f0;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #4a5568;
}

.view-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
}

.view-btn:hover {
    background-color: #2d3748;
    transform: translateY(-2px);
}

.view-btn i {
    margin-left: 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    z-index: 2000;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 0% auto;
    width: 90%;
    max-width: 945px;
    position: relative;
    animation: modalFadeIn 0.3s;
    border-radius: 12px;
    padding: 2rem;
    overflow: hidden;
    max-height: 99vh;
    display: flex;
    flex-direction: column;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--close-btn-bg);
    color: var(--primary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.close-modal:hover {
    background-color: var(--close-btn-hover);
    transform: rotate(90deg);
}

.modal-container {
    overflow-y: auto;
    max-height: 100vh;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-bg);
}

.modal-container::-webkit-scrollbar {
    width: 12px;
}

.modal-container::-webkit-scrollbar-track {
    background: var(--scrollbar-bg);
    border-radius: 10px;
}

.modal-container::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 10px;
    border: 3px solid var(--scrollbar-bg);
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

.modal-header {
    padding: 0.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background-color: white;
    border-radius: 8px 8px 0 0;
}

.modal-header h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    /* margin-bottom: 0.5rem; */
}

.modal-body {
    padding: 1rem;
    line-height: 1.6;
    color: #4a5568;
    text-align: justify;
}

.modal-body h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin: 1.5rem 0 0.75rem;
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-body a {
    text-decoration: none;
    color: #171b26;
    font-weight: bold;
}

.modal-body a:hover {
    text-decoration: underline;
    color: #e67e22;
}

.modal-body ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    background-color: #f8f9fa;
}

.back-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
}

.back-btn:hover {
    background-color: #3182ce;
    transform: translateY(-2px);
}

.back-btn i {
    margin-right: 0.5rem;
}

/* Responsive Styles */

@media (max-width: 955px) {

    .main-content {
        margin-left: 0;
        padding: 4rem 1rem 1rem;
    }

    .resources-grid {
        /* grid-template-columns: 1fr; */
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .category-btn {
        height: 36px;
        border-radius: 18px;
        font-size: 0.85rem;
        padding: 0 1rem;
        min-width: 70px;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-height: 99vh;
        max-width: 95%;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
    }

    .close-modal {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}


@media (max-width: 900px) {

    .main-content {
        margin-left: 0;
        padding: 4rem 1rem 1rem;
    }

    .resources-grid {
        /* grid-template-columns: 1fr; */
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .category-btn {
        height: 36px;
        border-radius: 18px;
        font-size: 0.85rem;
        padding: 0 1rem;
        min-width: 70px;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
    }

    .close-modal {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

@media (max-width: 600px) {

    .main-content {
        margin-left: 0;
        padding: 4rem 1rem 1rem;
    }

    .resources-grid {
        grid-template-columns: 2fr;
    }

    .category-btn {
        height: 36px;
        border-radius: 18px;
        font-size: 0.85rem;
        padding: 0 1rem;
        min-width: 70px;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 400px) {

    .main-content {
        margin-left: 0;
        padding: 4rem 1rem 1rem;
    }

    .resources-grid {
        grid-template-columns: 2fr;
    }

    .category-btn {
        height: 36px;
        border-radius: 18px;
        font-size: 0.85rem;
        padding: 0 1rem;
        min-width: 70px;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 1.5rem;
    }
}