/* Category Pages Shared Styles 
------------------------------------------ */
:root {
    --jungle-primary: #006400;
    --jungle-secondary: #228B22;
    --sky-primary: #0077be;
    --sky-secondary: #87CEEB;
    --city-primary: #1A237E;
    --city-secondary: #3F51B5;
}

/* Base Styles for Category Pages */
.category-page {
    background-color: #000; /* Dark background for better 3D contrast */
    color: #fff;
    overflow-x: hidden;
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
}

/* Environment Container */
.category-environment {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Canvas Styling */
#environment-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    touch-action: none; /* Prevents browser handling of touch gestures */
}

/* Category Title Overlay */
.category-title-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
    width: 80%;
}

.category-main-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
}

.category-subtitle {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid var(--brand-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-indicator p {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.loading-indicator.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Project Preview */
.project-preview {
    position: fixed;
    display: none;
    z-index: 100;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(10px);
    opacity: 0;
}

.project-preview.visible {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.preview-content {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 20px;
    width: 300px;
    color: var(--text-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.preview-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.preview-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.preview-description {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.preview-date {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 0.9rem;
    color: #666;
    display: block;
    margin-bottom: 15px;
}

.preview-cta {
    text-align: center;
}

.preview-button {
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(239, 142, 124, 0.3);
    transition: transform 0.3s ease;
}

/* Back to Categories Link */
.back-to-categories {
    position: fixed;
    top: 100px;
    left: 40px;
    display: flex;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    z-index: 100;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    opacity: 0;
}

.back-to-categories svg {
    margin-right: 8px;
    stroke-width: 2px;
}

.back-to-categories:hover {
    transform: translateX(-5px);
}

/* Theme-Specific Styles */
/* Tech/Jungle Theme */
.tech-category .site-header,
.tech-category .preview-button {
    --gradient-start: #006400;
    --gradient-end: #228B22;
}

.tech-category .preview-title {
    color: var(--jungle-primary);
}

.tech-category .back-to-categories {
    color: white; /* Changed from var(--jungle-primary) to white */
}

/* Content/Sky Theme */
.content-category .site-header,
.content-category .preview-button {
    --gradient-start: #0077be;
    --gradient-end: #87CEEB;
}

.content-category .preview-title {
    color: var(--sky-primary);
}

.content-category .back-to-categories {
    color: white; /* Changed to white for better visibility */
}

/* Strategy/City Theme */
.strategy-category .site-header,
.strategy-category .preview-button {
    --gradient-start: #1A237E;
    --gradient-end: #3F51B5;
}

.strategy-category .preview-title {
    color: var(--city-primary);
}

.strategy-category .back-to-categories {
    color: white; /* Changed to white for better visibility */
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile Project List Menu Styles */
.mobile-project-list-menu {
    display: none; /* Hidden on desktop by default */
    padding: 80px 15px 20px 15px; /* Add top padding to account for fixed header */
    box-sizing: border-box;
    min-height: 100vh; /* Ensure it takes full viewport height */
}

.mobile-project-list-menu .mobile-list-loading {
    text-align: center;
    padding: 40px 0;
    color: #ccc; /* Light text for loading message */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Re-using .spinner style from above, ensure it's defined before this or copy here */
/* .mobile-list-loading .spinner { ... } */

.mobile-project-card {
    display: flex;
    /* background-color: rgba(255, 255, 255, 0.92); Lighter card background, inspired by style.css featured-project-card */
    background-color: var(--bg-warm-white); /* Using the site's warm white */
    opacity: 0.95; /* Slight transparency */
    border-radius: 15px; /* Matching featured-project-card */
    margin-bottom: 20px;
    padding: 15px;
    text-decoration: none;
    color: var(--text-dark); /* Dark text for light cards */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07); /* Matching featured-project-card */
    border: 1px solid rgba(0, 0, 0, 0.05); /* Subtle dark border for light card */
}

.mobile-project-card:hover, /* For desktop testing or devices that show hover */
.mobile-project-card:focus { 
    /* background-color: rgba(255, 255, 255, 0.98); */
    background-color: rgb(225, 208, 186); /* Slightly darker warm white on hover */
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1); /* Matching featured-project-card hover */
    outline: none; /* Remove focus outline if not desired */
}

.mobile-project-card-thumbnail {
    width: 70px; 
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1); /* Slightly darker border on hover */
}

.mobile-project-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically center content if card height varies */
    flex-grow: 1;
    overflow: hidden; /* Prevent text overflow issues */
}

.mobile-project-card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem; 
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-dark); /* Dark text */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-project-card-tagline {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 0.8rem;
    color: #555; /* Darker grey for tagline */
    margin: 0 0 6px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(0.8rem * 1.3 * 2); /* Reserve space for 2 lines */
}

.mobile-project-card-date {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 0.7rem;
    color: #777; /* Medium grey for date */
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .category-page {
        /* If mobile list is on a light background, page bg might not need to be black */
        /* background-color: var(--bg-warm-white); */ /* Option: change page bg for mobile list view */
    }
    .mobile-project-list-menu {
         background-color: var(--bg-warm-white); 
    }

    .category-environment {
        display: none !important; /* Hide 3D environment on mobile */
    }
    .mobile-project-list-menu {
        display: block; /* Show 2D list on mobile */
        aria-hidden: "false";
    }
    .loading-indicator { /* Ensure main loading indicator for 3D is hidden if .category-environment is hidden */
        display: none !important;
    }
    .category-title-overlay, .back-to-categories, #sound-toggle /* Hide 3D specific UI */ {
        display: none !important; 
    }

    .category-main-title {
        font-size: 2.5rem;
    }
    
    .category-subtitle {
        font-size: 1.2rem;
    }
    
    .back-to-categories {
        top: 80px;
        left: 20px;
        font-size: 0.9rem;
    }
    
    .preview-content {
        width: 260px;
        padding: 15px;
    }
    
    .preview-title {
        font-size: 1.2rem;
    }
    
    .preview-image {
        height: 130px;
    }
    
    .preview-description {
        font-size: 0.9rem;
    }
    
    .preview-button {
        font-size: 0.9rem;
        padding: 8px 16px;
    }
}
