:root {
    --primary: #D8959B;
    --primary-dark: #B47F84;
    --accent: #829672;
    --mist: #f4f3f1;
    --peony: #f2d1d4;
    --gray-100: #f4f3f1;
    --gray-200: #e9e8e6;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --peony-light: #fdf2f4;
    --primary-light: #34495e;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --text-muted: #64748b;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--mist);
    color: var(--gray-900);
    line-height: 1.5;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: white;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.header-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.header-icon {
    width: 40px;
    height: 40px;
}

.header h1 {
    font-size: 1.75rem;
    color: var(--primary-dark);
    font-weight: 600;
    margin: 0;
    text-align: center;
}

.search-bar {
    position: relative;
    margin-bottom: 1rem;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    border: 1px solid var(--peony);
    border-radius: 0.5rem;
    font-size: 1rem;
    color: var(--gray-900);
    background: white;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(216, 149, 155, 0.1);
}

.search-button {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
}

.breadcrumb {
    color: var(--gray-500);
    font-size: 0.875rem;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-item .separator {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Main Content */
.main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.major-categories {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.minor-categories {
    margin-top: 2rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.minor-category-layer {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.category-button {
    padding: 1.25rem 2rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-align: center;
    min-width: 180px;
    max-width: 250px;
    width: 100%;
}

.category-button.major {
    background: linear-gradient(90deg, #D8959B, #B47F84);
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.category-button.major:hover {
    background: linear-gradient(90deg, #B47F84, #D8959B); /* Lighter gradient on hover */
    transform: scale(1.05); /* Slightly increase size on hover */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Increase shadow on hover */
}

.category-button.minor {
    flex: 0 1 auto;
    min-width: 150px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    background-color: var(--peony-light);
    color: var(--primary-dark);
    border: 1px solid var(--peony);
    transition: all 0.3s ease;
}

.category-button.minor:hover {
    background-color: var(--peony);
    transform: translateY(-2px);
}

.resource-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.resource-category {
    padding: 0.25rem 0.75rem;
    background: var(--peony);
    border-radius: 1rem;
    font-size: 0.75rem;
    color: var(--primary-dark);
}

/* Resources Section */
.resources-section {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.resources-section.hidden {
    opacity: 0;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.resource-card {
    background: white; /* Set background color to white */
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.resource-link {
    display: block;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
}

.resource-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.resource-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--peony-light);
    color: var(--primary-dark);
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: capitalize;
}

/* Resource Type Backgrounds */
.video-bg { background: linear-gradient(135deg, var(--peony), white); }
.document-bg { background: linear-gradient(135deg, var(--mist), white); }
.link-bg { background: linear-gradient(135deg, var(--primary), white); }

/* No Results State */
.no-resources {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
    background: white;
    border-radius: 0.75rem;
    border: 1px dashed var(--peony);
}

/* Error State */
.error-message {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    text-align: center;
}

.retry-button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.retry-button:hover {
    background: var(--primary-dark);
}

.subcategories-container {
    margin-top: 2rem;
}

.subcategories-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.current-category {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin: 0;
}

.subcategories-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.show-all-btn {
    padding: 0.5rem 1rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.show-all-btn:hover {
    background-color: var(--primary-dark);
}

.subcategories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.subcategory-button {
    padding: 0.5rem 1rem;
    background-color: var(--peony-light);
    color: var(--primary-dark);
    border: 1px solid var(--peony);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

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

.subcategory-button.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Footer */
.footer {
    background: white;
    padding: 3rem 1.5rem;
    margin-top: auto;
    box-shadow: var(--shadow);
}

.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-logos img {
    height: 60px;
    width: auto;
}

.footer-info {
    text-align: center;
    margin-bottom: 2rem;
}

.footer-info h2 {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.footer-info p {
    color: var(--gray-600);
    margin: 0.25rem 0;
}

.footer-copyright {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
    border-top: 1px solid var(--peony);
    padding-top: 1.5rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header-top {
        flex-direction: column;
        text-align: center;
        margin-bottom: 1rem;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .main {
        padding: 1rem;
    }

    .major-categories,
    .minor-categories {
        grid-template-columns: 1fr;
    }

    .category-button.primary {
        padding: 1.25rem;
    }

    .footer-logos {
        flex-direction: column;
        gap: 1.5rem;
    }

    .footer {
        padding: 2rem 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .resources-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium tablets and small laptops */
@media (min-width: 1025px) and (max-width: 1366px) {
    .resources-section {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Prevent body scroll when sidebar is open */
body.sidebar-open {
    overflow: hidden;
}

/* Touch-friendly hover states */
@media (hover: none) {
    .app-sidebar-link:hover,
    .submenu-link:hover,
    .resource-card:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    :root {
        --text-light: #595959;
        --header-shadow: rgba(0, 0, 0, 0.15);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Remove swipe indicator styles */
.swipe-indicator {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Adjust search wrapper position for mobile view */
@media screen and (max-width: 320px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-wrapper {
        width: 100%;
        margin-top: 8px;
    }

    .search-input {
        width: calc(100% - 48px); /* Adjust width for icon */
    }
}

.app-footer {
    background: white;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

.footer-logos {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-logo {
    height: 60px;
    width: auto;
}

.footer-info {
    margin-bottom: 1.5rem;
}

.footer-info h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.footer-info p {
    margin: 0.25rem 0;
}

.footer-copyright {
    font-size: 0.875rem;
    color: #666;
}

@media screen and (max-width: 768px) {
    .header-main {
        flex-direction: column;
        text-align: center;
    }

    .header-title {
        font-size: 1.25rem;
    }

    .main-content {
        padding: 1rem;
    }

    .major-categories, .minor-categories {
        grid-template-columns: 1fr;
    }

    .footer-logos {
        flex-direction: column;
        align-items: center;
    }
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    .major-categories {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .minor-category-layer {
        flex-direction: column;
        gap: 0.75rem;
    }

    .category-button {
        max-width: 100%;
        padding: 1rem 1.5rem;
    }

    .category-button.major {
        font-size: 1.1rem;
    }

    .category-button.minor {
        font-size: 0.95rem;
        padding: 0.875rem 1.25rem;
    }
}

/* Tablet optimization */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .category-button {
        min-width: 160px;
        max-width: 200px;
    }

    .minor-category-layer {
        gap: 0.875rem;
    }
}

/* Larger screens */
@media screen and (min-width: 1025px) {
    .major-categories {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }

    .minor-categories {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }
}

.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: var(--primary);
    color: white;
    transform: translateX(-5px);
}

.back-button svg {
    transition: transform 0.3s ease;
}

.back-button:hover svg {
    transform: translateX(-3px);
}

.categories-container {
    display: none; /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.categories-container.visible {
    display: block;
    opacity: 1;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

/* Commenting out the conflicting resource-card styles */
/* .resource-card {
    background: var(--mist);
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    cursor: pointer;
} */

.resource-content {
    padding: 1.5rem;
}

.resource-title {
    font-size: 1rem;
    font-weight: bold;
    margin: 0;
}

.resource-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.resource-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.resource-tag {
    font-size: 0.8rem;
    color: var(--text);
    background: var(--background);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

.resource-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8f8f8;
    border-top: 1px solid #eee;
}

.resource-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resource-link:hover {
    text-decoration: underline;
}

.resource-type {
    color: #888;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}
