/* LFS Mod Batch Checker - Main Stylesheet */
/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

@font-face {
    font-family: 'RohnRounded';
    src: url('RohnRounded-HeavyItalic.ttf') format('truetype');
    font-weight: 900;
    font-style: italic;
}

/* Base Styles */
body {
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 0.6rem 0.2rem;
    display: inline-block;
    overflow: visible;
    line-height: 1.3;
}

.spinner {
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-left-color: #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px);
}

.upload-zone {
    border: 2px dashed #cbd5e1;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
}

/* Advanced Mode - Hidden by default */
.advanced-mode-only {
    display: none !important;
}

body.advanced-mode .advanced-mode-only {
    display: block !important;
}

body.advanced-mode .advanced-mode-only.flex {
    display: flex !important;
}

.btn-gradient:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-gradient:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.status-badge {
    animation: pulse-subtle 2s ease-in-out infinite;
}

@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.tab-title {
    font-family: 'RohnRounded', sans-serif;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
}

.message-slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Mobile responsive grid */
@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1rem;
    }
}

.mod-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mod-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.mod-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.mod-thumbnail::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mod-card:hover .mod-thumbnail::before {
    opacity: 1;
}

/* Thumbnail hover overlay with clickable links */
.thumbnail-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.mod-thumbnail:hover .thumbnail-overlay {
    opacity: 1;
}

.overlay-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: bold;
    font-size: 0.875rem;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.overlay-link:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Split view: top half for LFS.net, bottom half for source */
.overlay-link-top {
    flex: 1;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.9) 0%, rgba(102, 126, 234, 0.85) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.overlay-link-bottom {
    flex: 1;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.85) 0%, rgba(16, 185, 129, 0.9) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Full height for single link (no source) */
.overlay-link-full {
    flex: 1;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
}

.allowed-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.stat-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-left: 4px solid #667eea;
}

.filter-toggle {
    border: 2px solid #d1d5db;
    background: white;
    color: #6b7280;
    cursor: pointer;
}

.filter-toggle:hover {
    border-color: #9ca3af;
}

.filter-toggle-active {
    background: #06b6d4;
    color: white;
    border-color: #06b6d4;
}

.filter-toggle-active:hover {
    background: #0891b2;
    border-color: #0891b2;
}

/* NEW STYLE FOR COMBINED APPROVAL BUTTON */
#toggleApprovalCombined.filter-toggle-approved {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}
#toggleApprovalCombined.filter-toggle-approved:hover {
    background: #16a34a;
    border-color: #16a34a;
}
#toggleApprovalCombined.filter-toggle-unapproved {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}
#toggleApprovalCombined.filter-toggle-unapproved:hover {
    background: #d97706;
    border-color: #d97706;
}

/* NEW STYLE FOR ALL APPROVAL STATE */
#toggleApprovalCombined.filter-toggle-all {
    background: #06b6d4; /* Cyan background for 'All' state */
    color: white;
    border-color: #06b6d4;
}
#toggleApprovalCombined.filter-toggle-all:hover {
    background: #0891b2;
    border-color: #0891b2;
}

/* TAB NAVIGATION STYLES - Chrome-like */
.tab-button {
    background: #86888c;
    color: #374151;
    border: none;
    border-radius: 12px 12px 0 0;
    cursor: pointer;
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: -12px;
    padding-bottom: 12px;
    z-index: 0;
    white-space: nowrap;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Mobile: Make tabs smaller and allow wrapping */
@media (max-width: 768px) {
    .tab-button {
        flex: 1 1 calc(33.333% - 4px);
        font-size: 0.65rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }
    .tab-container {
        padding: 0.25rem;
        max-width: 100%;
        overflow: hidden;
    }
    #tabContentContainer {
        overflow-x: hidden;
        max-width: 100%;
    }
    body {
        padding: 0.5rem !important;
    }
    .glass-effect {
        padding: 0.75rem !important;
    }
}

.tab-button:hover {
    background: #c4c7cc;
    color: #1f2937;
}

/* Adjust text position in inactive tabs */
.tab-button:not(.tab-active) {
    align-items: flex-start;
    padding-top: 14px;
}

/* Tab 1 - LFS Mods (Green) */
#tab1.tab-active {
    background: #f3f4f6;
    color: #1f2937;
    z-index: 10;
    margin-bottom: -3px;
    border: 3px solid #6b7280;
    border-bottom: none;
    box-sizing: border-box;
    font-size: 1.5rem;
    font-weight: 800;
}

/* Tab 2 - Car Sources (Blue) */
#tab2.tab-active {
    background: #f3f4f6;
    color: #1f2937;
    z-index: 10;
    margin-bottom: -3px;
    border: 3px solid #6b7280;
    border-bottom: none;
    box-sizing: border-box;
    font-size: 1.5rem;
    font-weight: 800;
}

/* Tab 3 - Creator Portfolios (Purple) */
#tab3.tab-active {
    background: #f3f4f6;
    color: #1f2937;
    z-index: 10;
    margin-bottom: -3px;
    border: 3px solid #6b7280;
    border-bottom: none;
    box-sizing: border-box;
    font-size: 1.5rem;
    font-weight: 800;
}

/* Tab 4 - Car Components (Orange) */
#tab4.tab-active {
    background: #f3f4f6;
    color: #1f2937;
    z-index: 10;
    margin-bottom: -3px;
    border: 3px solid #6b7280;
    border-bottom: none;
    box-sizing: border-box;
    font-size: 1.5rem;
    font-weight: 800;
}

/* Tab 5 - Tutorials (Red) */
#tab5.tab-active {
    background: #f3f4f6;
    color: #1f2937;
    z-index: 10;
    margin-bottom: -3px;
    border: 3px solid #6b7280;
    border-bottom: none;
    box-sizing: border-box;
    font-size: 1.5rem;
    font-weight: 800;
}

/* Tab 6 - Search-Engine (Cyan) */
#tab6.tab-active {
    background: #f3f4f6;
    color: #1f2937;
    z-index: 10;
    margin-bottom: -3px;
    border: 3px solid #6b7280;
    border-bottom: none;
    box-sizing: border-box;
    font-size: 1.5rem;
    font-weight: 800;
}

/* Tab container wrapper - holds tabs and content with grey background */
.tab-container {
    background: transparent;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Tab content container gets border from active tab */
#tabContentContainer {
    border-radius: 12px;
    border: 3px solid #6b7280;
    margin-top: 0;
    border-top-left-radius: 0; /* Connect to first tab by default */
    background: #f3f4f6;
    position: relative;
    z-index: 5;
    transition: none !important; /* Disable all transitions to prevent jiggling */
}

/* STYLES FOR SOURCE FILTER BUTTON */
#toggleSourceFilter.filter-toggle-with {
    background: #22c55e; /* Green for 'With Sources' */
    color: white;
    border-color: #22c55e;
}
#toggleSourceFilter.filter-toggle-with:hover {
    background: #16a34a;
    border-color: #16a34a;
}
#toggleSourceFilter.filter-toggle-without {
    background: #f59e0b; /* Amber for 'Without Sources' */
    color: white;
    border-color: #f59e0b;
}
#toggleSourceFilter.filter-toggle-without:hover {
    background: #d97706;
    border-color: #d97706;
}
#toggleSourceFilter.filter-toggle-all {
    background: #06b6d4; /* Cyan for 'All' */
    color: white;
    border-color: #06b6d4;
}
#toggleSourceFilter.filter-toggle-all:hover {
    background: #0891b2;
    border-color: #0891b2;
}

/* Search input clear button styles */
.search-input-wrapper {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #9ca3af;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.search-clear-btn:hover {
    background: #6b7280;
}

.search-clear-btn.visible {
    display: flex;
}

.debug-output {
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 8px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.debug-success { color: #4ade80; }
.debug-error { color: #f87171; }
.debug-warning { color: #fbbf24; }
.debug-info { color: #60a5fa; }

/* Search result card aspect ratio classes with smooth transitions */
.search-card {
    /* Only transition transform on hover - aspect ratio changes instantly for performance */
    transition: transform 0.3s ease;
    /* Performance: use GPU compositing for transforms */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Smooth aspect ratio transition ONLY when slider changes (not constantly) */
.search-card.aspect-transitioning {
    transition: aspect-ratio 0.3s ease, transform 0.3s ease;
}

.search-card.aspect-square {
    aspect-ratio: 1 / 1;
}

.search-card.aspect-portrait {
    aspect-ratio: 5 / 6;
}

/* Hover scale classes - different scales for different column counts */
.search-card.hover-scale-small:hover {
    transform: scale(1.02) translateZ(0);
}

.search-card.hover-scale-medium:hover {
    transform: scale(1.03) translateZ(0);
}

.search-card.hover-scale-large:hover {
    transform: scale(1.05) translateZ(0);
}

/* Bring hovered card to front */
.search-card:hover {
    z-index: 50;
}

/* Badge size classes for different column counts */
.badge-small {
    font-size: clamp(0.5rem, 1.2vw, 0.75rem);
    padding: clamp(0.125rem, 1%, 0.25rem) clamp(0.375rem, 2%, 0.5rem);
}

.badge-large {
    font-size: clamp(0.45rem, 1vw, 0.65rem);
    padding: clamp(0.1rem, 0.8%, 0.2rem) clamp(0.25rem, 1.5%, 0.35rem);
}

/* Mobile responsive controls */
@media (max-width: 768px) {
    .controls-container {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .controls-container > * {
        width: 100% !important;
    }

    .columns-control {
        display: none !important; /* Hide column slider on mobile */
    }

    h1 {
        font-size: 1.75rem !important;
    }

    .header-subtitle {
        font-size: 0.875rem !important;
    }

    .filter-section {
        gap: 0.5rem !important;
    }

    .mod-card {
        border-radius: 8px !important;
    }

    .glass-effect {
        padding: 1rem !important;
        border-radius: 1rem !important;
    }

    #tabContentContainer {
        overflow-x: hidden !important;
    }
}

/* ========================================
   UTILITY CLASSES FOR REPEATED PATTERNS
   ======================================== */

/* Standard search input styling - used across multiple tabs */
.search-input-standard {
    width: 260px;
    outline: none !important;
    box-shadow: none !important;
}

/* Standard badge container - for count displays */
.badge-container-standard {
    min-width: 200px;
    text-align: center;
}

/* Flex button layout - for master update buttons */
.btn-flex-standard {
    flex: 1 1 0;
    min-width: 0;
}

/* LFS logo positioning */
.lfs-logo-position {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    transition: filter 0.3s ease;
    transform: translate(27px, -24px);
}

/* nukEd logo link styling */
.nuked-logo-link {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    transition: filter 0.3s ease;
}

/* nukEd logo image sizing */
.nuked-logo-img {
    height: 3rem;
    width: auto;
}

/* Fixed overlay for password dialog */
.fixed-overlay-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* Default search results grid (5 columns) */
.search-grid-default {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(5, 1fr);
}

/* Load more trigger placeholder */
.load-more-trigger {
    height: 20px;
    margin: 20px 0;
}

/* Performance monitor initial hidden state */
.performance-monitor-init {
    min-width: 300px;
    display: none;
}
