/* styles.css */

:root {
    --bg-main: #000;
    --bg-panel: #111;
    --text-main: #fff;
    --text-muted: #b9b9b9;
    --accent: #d4af37;
    --border-color: #d4af37;
    --card-bg: #111;
}

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

html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background-color: var(--bg-panel);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title-container {
    display: flex;
    align-items: center;
}

 #subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}
#creator-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}


.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Filter Panel */
#filter-panel {
    width: 300px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
}

#filter-panel h2 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: var(--accent);
}

.filter-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
}

.filter-group input, 
.filter-group select {
    width: 100%;
    padding: 0.5rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 4px;
}

.filter-group select[multiple] {
    height: 120px;
}

.filter-group small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

#reset-filters {
    width: 100%;
    background-color: #444;
    color: white;
    margin-top: 1rem;
}

#reset-filters:hover {
    background-color: #555;
}

/* Main Content Area */
main {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.tabs {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.7rem;
}

.tab-btn {
    background-color: transparent;
    color: var(--text-muted);
    font-size: 1.1rem;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.5rem 0;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.tab-btn:hover {
    color: var(--text-main);
}

/* New styles for cookie-intro section */
#cookie-intro {
    margin-bottom: 1.5rem;
}
#cookie-intro h2 {
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-btn:hover {
    color: var(--text-main);
}

/* Grids */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.hidden {
    display: none !important;
}

/* Base Card Styling (For JS to generate) */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    border: 1px solid var(--text-main);
}

.card img {
    width: 100%; /* Make image responsive to card width */
    height: auto; /* Maintain aspect ratio */
    object-fit: cover;
    margin-bottom: 0.5rem;
}

.card h3 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.card p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Details Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--bg-panel);
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    border-radius: 8px;
    padding: 2rem;
    position: relative;
    overflow-y: auto;
    border: 2px solid var(--border-color);
}

.close-btn {
    position: sticky;
    float: right;
    top: 1rem;
    margin-top: -0.7rem;
    margin-right: 0.7rem;
    margin-bottom: -2.2rem;
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-size: 3rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    z-index: 100;
}

.close-btn:hover {
    color: var(--text-main);
    border-color: var(--text-main);
}

/* Add to styles.css */

.modal-main-content {
    display: grid;
    grid-template-columns: 7fr 3fr; /* 70% for left content, 30% for tags */
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.modal-header-info {
    grid-column: 1 / 2; /* Spans the first column */
}

.modal-cookie-name {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.modal-cookie-subtitle {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.modal-image-container {
    grid-column: 1 / 2; /* Spans the first column */
    text-align: center;
    margin-bottom: 1rem;
}

.modal-image-container img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.modal-tags-info {
    grid-column: 2 / 3; /* Spans the second column */
    grid-row: 1 / span 2; /* Spans both rows in the second column */
}

.modal-tag-group {
    margin-bottom: 1.75rem;
}

.modal-tag-title {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.modal-tag-list {
    font-size: 1.5rem; /* Default desktop size */
}

.family-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.family-link {
    background: none;
    border: none;
    color: #fff;
    text-align: left;
    padding: 0;
    font-size: inherit; /* Inherit font size from parent .modal-tag-list */
    font-weight: normal;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.family-link:hover {
    color: #e5c354; /* Lighter gold on hover */
}

.modal-skill-description {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.modal-skill-name {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.modal-skill-cooldown {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.modal-skill-desc {
    white-space: pre-wrap;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff; /* White text on gold looks sharp */
    padding: 0.75rem;
    border-radius: 4px;
    font-weight: bold;
    border: none; /* Ensure no default button border */
    cursor: pointer; /* Indicate it's clickable */
    transition: background-color 0.2s ease; /* Smooth transition for hover */
}

.btn-primary:hover {
    background-color: #e5c354;
}

/* Tag Modal Specifics */
.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.tag-toggle {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 20px; /* Makes them look like pills */
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tag-toggle:hover {
    border-color: var(--accent);
    color: var(--text-main);
}

/* The active/selected state */
.tag-toggle.selected {
    background-color: rgba(212, 175, 55, 0.15); /* Faint gold background */
    border-color: var(--accent);
    color: var(--accent);
}

/* --- Responsive Design --- */

/* This class is added via JS to control the modal's top section */
/* Removed .modal-body-grid as it's replaced by .modal-main-content */

/* Media query for mobile devices */
@media (max-width: 800px) {
    /* App container layout */
    .app-container {
        flex-direction: column;
        overflow-y: auto;
    }

    /* --- COMPACT MOBILE FILTER PANEL --- */
    #filter-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        overflow-y: visible;
        flex-shrink: 0;
        padding: 1rem; /* Tighter padding */
        
        /* Flexbox magic to arrange the buttons side-by-side */
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    #filter-panel h2 {
        width: 100%; /* Keeps the title on its own row */
        margin-bottom: 0;
        font-size: 1.1rem;
    }

    .filter-group {
        margin-bottom: 0; /* Removes old desktop margin */
        flex: 1 1 45%; /* Forces the buttons into two columns */
    }

    /* Forces ONLY the Search bar to span the full width */
    .filter-group:nth-of-type(1) {
        flex: 1 1 100%;
    }

    #reset-filters {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* Main content area */
    main {
        overflow-y: visible;
        padding: 1rem;
    }

    /* Header layout */
    header {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
        text-align: center;
    }
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 1rem;
    }

    .modal-main-content {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    /* Reset the grid column/row locks from the desktop version */
    .modal-header-info,
    .modal-image-container,
    .modal-tags-info {
        grid-column: auto;
        grid-row: auto;
    }

    /* Make the tag list text a bit smaller so it doesn't crowd mobile screens */
    .modal-tag-list {
        font-size: 1.1rem;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .tab-btn {
        flex-shrink: 0;
    }
}

/* --- CSV to JSON Converter Specific Styles --- */
.csv-converter-container {
    max-width: 800px;
    margin: 20px auto; /* Center the container with some top/bottom margin */
    background-color: var(--bg-panel);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.csv-converter-container h1 {
    color: var(--accent);
    text-align: center;
    margin-bottom: 20px;
}

.csv-input-section,
.csv-output-section {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-main); /* Slightly darker background for sections */
}

.csv-input-section label,
.csv-output-section label {
    color: var(--text-muted); /* Use muted text for labels */
    margin-bottom: 10px;
}

.csv-input-section input[type="file"] {
    width: 100%;
    padding: 8px;
    background-color: var(--bg-panel); /* Match panel background */
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 4px;
    box-sizing: border-box;
    margin-bottom: 15px; /* Space between input and button */
}

.csv-output-section .btn-primary {
    margin-bottom: 10px; /* Space between copy button and pre tag */
}

/* Specific styles ONLY for the homepage */
body {
    margin: 0;
    overflow-x: hidden;
}

.bg-blurred {
    position: fixed;
    top: -5%; left: -5%; width: 110%; height: 110%;
    background: url('bground.webp') no-repeat center;
    background-size: 100% 100vh;
    background-size: cover;
    filter: blur(10px) brightness(0.6);
    z-index: -1;
}

.bg-secondary {
    position: absolute;
    bottom: 1%; left: 10%; width: 50%; height: 40vh;
    background: url('betterCute.png') no-repeat bottom left;
    background-size: contain;
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

/* Container for the scrollable layout */
.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
}

/* Hero section - Takes up the full first screen */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    width: 100%;
}

/* Main title */
.hero-section h1 {
    font-size: 4rem; /* Made the title a bit bigger since it has the screen to itself */
    margin-bottom: 1rem;
    color: var(--accent, #d4af37);
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
}

/* Subtle scroll indicator animation */
.scroll-hint {
    position: absolute;
    bottom: 3rem;
    color: var(--text-main, #ffffff);
    font-size: 1.2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Content section - Appears when you scroll down */
.content-section {
    min-height: 100vh; /* Pushes it down into its own scroll space */
    height: auto; /* Allows content to expand without overflowing */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 2rem;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

/* Updated splash text for better readability over the image */
.splashtext {
    max-width: 670px;
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-main, #ffffff);
    margin-bottom: 2.5rem;
    background: rgba(30, 30, 30, 0.7); /* Adds a dark, semi-transparent box behind the text */
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, #333);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* Features Grid for Homepage */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    width: 100%;
    margin-top: 2rem;
}

.feature-card {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent, #d4af37);
    box-shadow: 0 8px 25px rgba(0,0,0,0.7);
}

.feature-card .btn-primary {
    margin-bottom: 1.5rem;
    width: 80%;
}

.feature-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main, #ffffff);
}

/* Quick Links Grid for Homepage */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    width: 100%;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.quick-link-card {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    padding: 2rem 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: var(--text-main, #ffffff);
    font-size: 1.4rem;
    font-weight: bold;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.quick-link-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent, #d4af37);
    background-color: rgba(212, 175, 55, 0.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.7);
    color: var(--accent, #d4af37);
}

/* Extracting inline styles to classes for easier mobile adjustments */
.landing-buttons {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}
.landing-buttons .btn-primary {
    text-decoration: none;
    padding: 18px 36px;
    font-size: 1.4rem;
    border-radius: 8px;
    background: var(--accent, #d4af37);
    color: #fff;
    font-weight: bold;
}
.spacer-large { height: 18rem; }
.spacer-small { height: 3rem; }

/* Mobile adjustments */
@media (max-width: 800px) {
    .hero-section h1 {
        font-size: 2.2rem;
        padding: 0 1rem;
        word-wrap: break-word;
    }
    .hero-section h2 {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    .content-section {
        padding: 1rem;
    }
    .splashtext {
        padding: 1.2rem;
        font-size: 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    .landing-buttons {
        gap: 1rem;
        flex-direction: column;
        width: 100%;
    }
    .landing-buttons .btn-primary {
        font-size: 1.2rem;
        padding: 15px 20px;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
    .features-grid {
        grid-template-columns: 1fr; /* Stacks cards into a single column */
        gap: 1.5rem;
        width: 100%;
    }
    .feature-card {
        padding: 1.5rem 1rem;
        width: 100%;
        box-sizing: border-box;
    }
    .feature-card .btn-primary {
        width: 100%; /* Makes buttons full width inside the card */
        font-size: 1.2rem;
        padding: 12px 20px;
        box-sizing: border-box;
    }
    .quick-links-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); /* Allows 2 tiles side-by-side on small screens */
        gap: 0.75rem;
        width: 100%;
    }
    .quick-link-card {
        padding: 1rem 0.5rem;
        font-size: 1.1rem;
    }
    .spacer-large { height: 5rem; }
    .spacer-small { height: 1.5rem; }
}

/* Timeline styles */
.timeline {
    position: relative;
    max-width: 670px; /* matches splashtext max-width */
    margin: 0 auto;
    padding: 10px 0;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--accent, #d4af37);
    top: 0;
    bottom: 0;
    left: 20px;
    border-radius: 2px;
}
.timeline-item {
    padding: 10px 0 10px 50px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}
.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 10px;
    background-color: rgba(30, 30, 30, 1);
    border: 4px solid var(--accent, #d4af37);
    top: 20px;
    border-radius: 50%;
    z-index: 1;
}
.timeline-content {
    padding: 15px 20px;
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    color: var(--text-main, #ffffff);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
.timeline-date {
    font-size: 0.9rem;
    color: var(--accent, #d4af37);
    margin-bottom: 8px;
    font-weight: bold;
}
.timeline-message {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.4;
}