@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* CurseForge Official Colors */
    --cf-orange: #F16436;
    --cf-orange-dark: #D14D27;
    --cf-orange-light: #FF7B54;

    /* MOTY 2025 Gold Accent - Enhanced */
    --moty-gold: #FFB33E;
    --moty-gold-light: #FFC966;
    --moty-gold-dark: #E6A02E;
    --moty-gold-glow: rgba(255, 179, 62, 0.4);
    --moty-gold-glow-strong: rgba(255, 179, 62, 0.6);
    --moty-gold-bg: rgba(255, 179, 62, 0.12);

    /* Backgrounds - Enhanced for MOTY theme */
    --bg-primary: #1B1B22;
    --bg-secondary: #13131A;
    --card-bg: #26262F;
    --card-hover: #2F2F3A;
    --card-moty-accent: rgba(255, 179, 62, 0.05);

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --text-moty-gold: #FFB33E;

    /* Borders - Enhanced with MOTY gold */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-bright: rgba(241, 100, 54, 0.3);
    --border-moty: rgba(255, 179, 62, 0.3);
    --border-moty-strong: rgba(255, 179, 62, 0.5);

    /* Shadows - Enhanced with gold glow */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-moty: 0 0 20px 5px var(--moty-gold-glow);
    --shadow-moty-strong: 0 0 30px 8px var(--moty-gold-glow-strong);

    /* Fonts */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background - Enhanced MOTY theme */
.background-glow {
    position: fixed;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 120vw;
    height: 120vh;
    background: radial-gradient(circle at 50% 0%,
            rgba(241, 100, 54, 0.1) 0%,
            rgba(255, 179, 62, 0.08) 20%,
            rgba(255, 201, 102, 0.05) 40%,
            transparent 65%);
    z-index: -1;
    pointer-events: none;
    animation: glowPulse 10s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header with MOTY Badge */
header {
    padding: 40px 0;
    text-align: center;
    position: relative;
}

.moty-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--moty-gold-bg) 0%, rgba(255, 201, 102, 0.08) 100%);
    border: 2px solid var(--moty-gold);
    padding: 10px 24px;
    margin-bottom: 24px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--moty-gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 0 15px 3px var(--moty-gold-glow);
    animation: badgePulse 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 15px 3px var(--moty-gold-glow);
        border-color: var(--moty-gold);
    }

    50% {
        box-shadow: 0 0 25px 8px var(--moty-gold-glow-strong);
        border-color: var(--moty-gold-light);
    }
}

.moty-badge::before {
    content: '🏆';
    font-size: 1.2rem;
}

h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.brand-name {
    background: linear-gradient(135deg, var(--cf-orange) 0%, var(--cf-orange-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(241, 100, 54, 0.3));
}

.highlight {
    background: linear-gradient(135deg, var(--moty-gold) 0%, var(--moty-gold-light) 50%, #FFD699 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px var(--moty-gold-glow));
    position: relative;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 40px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.subtitle strong {
    color: var(--moty-gold);
    font-weight: 600;
}

/* Enhanced Search Bar */
.search-container {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
}

#search-input {
    width: 100%;
    padding: 18px 70px 18px 24px;
    border: 2px solid var(--border-subtle);
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-moty-accent) 100%);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-main);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#search-input::placeholder {
    color: var(--text-muted);
}

#search-input:hover {
    border-color: var(--border-moty);
    background: linear-gradient(135deg, var(--card-hover) 0%, var(--card-moty-accent) 100%);
    box-shadow: 0 0 15px 2px var(--moty-gold-glow);
}

#search-input:focus {
    outline: none;
    border-color: var(--moty-gold);
    background: linear-gradient(135deg, var(--card-hover) 0%, var(--card-moty-accent) 100%);
    box-shadow: 0 0 0 4px rgba(255, 179, 62, 0.15), 0 0 20px 4px var(--moty-gold-glow);
}

#search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--cf-orange) 0%, var(--moty-gold) 100%);
    border: none;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md), 0 0 10px rgba(255, 179, 62, 0.3);
}

#search-btn:hover {
    transform: translateY(-50%) scale(1.08);
    background: linear-gradient(135deg, var(--cf-orange-light) 0%, var(--moty-gold-light) 100%);
    box-shadow: var(--shadow-lg), var(--shadow-moty);
}

#search-btn:active {
    transform: translateY(-50%) scale(0.95);
    box-shadow: var(--shadow-sm);
}

/* Modern Grid Layout */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 48px 0 80px;
}

/* Enhanced Mod Cards - MOTY 2025 Theme */
.mod-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-moty-accent) 100%);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
}

.mod-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--cf-orange) 0%, var(--moty-gold) 50%, var(--moty-gold-light) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 10px var(--moty-gold-glow);
}

.mod-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, var(--moty-gold-bg) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mod-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl), var(--shadow-moty);
    border-color: var(--border-moty);
    background: linear-gradient(135deg, var(--card-hover) 0%, var(--card-moty-accent) 100%);
}

.mod-card:hover::before {
    opacity: 1;
}

.mod-card:hover::after {
    opacity: 1;
}

.mod-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #2a2a35 0%, #1f1f28 100%);
    border-bottom: 1px solid var(--border-subtle);
}

.mod-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mod-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.mod-card:hover .mod-title {
    color: var(--moty-gold);
    text-shadow: 0 0 8px var(--moty-gold-glow);
}

.mod-author {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mod-author::before {
    content: 'by';
    color: var(--text-muted);
    font-weight: 400;
}

.mod-summary {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
    flex: 1;
}

.mod-stats {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.mod-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.downloads-badge {
    background: linear-gradient(135deg, rgba(241, 100, 54, 0.15) 0%, rgba(255, 179, 62, 0.12) 100%);
    color: var(--cf-orange);
    padding: 4px 12px;
    font-weight: 700;
    border: 1px solid rgba(241, 100, 54, 0.2);
    box-shadow: 0 0 8px rgba(241, 100, 54, 0.2);
    transition: all 0.2s ease;
}

.mod-card:hover .downloads-badge {
    background: linear-gradient(135deg, rgba(241, 100, 54, 0.2) 0%, rgba(255, 179, 62, 0.18) 100%);
    border-color: var(--moty-gold);
    box-shadow: 0 0 12px var(--moty-gold-glow);
    color: var(--moty-gold);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px 20px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 500;
}

/* Modern Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-primary);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    padding: 40px;
    position: relative;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.close-modal {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-thumb {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 2px solid var(--border-subtle);
}

.modal-title {
    flex: 1;
}

.modal-title h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.2;
}

.modal-details {
    color: var(--text-secondary);
    line-height: 1.8;
}

.modal-details p {
    margin-bottom: 12px;
}

.modal-details strong {
    color: var(--text-primary);
    font-weight: 700;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--cf-orange) 0%, var(--moty-gold) 100%);
    color: white;
    padding: 14px 28px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md), 0 0 15px rgba(255, 179, 62, 0.3);
    border: 1px solid rgba(255, 179, 62, 0.3);
}

.download-btn:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, var(--cf-orange-light) 0%, var(--moty-gold-light) 100%);
    box-shadow: var(--shadow-lg), var(--shadow-moty);
    border-color: var(--moty-gold);
}

.download-btn::after {
    content: '→';
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.download-btn:hover::after {
    transform: translateX(4px);
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(241, 100, 54, 0.1);
    border-left-color: var(--cf-orange);
    width: 48px;
    height: 48px;
    animation: spin 0.8s linear infinite;
    margin: 80px auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 32px 0 60px;
    }

    .modal-content {
        padding: 24px;
    }

    .modal-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .modal-thumb {
        width: 100px;
        height: 100px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--card-bg);
    border: 3px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--card-hover);
}