* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --background: #0a0e27;
    --surface: rgba(30, 41, 59, 0.4);
    --surface-hover: rgba(30, 41, 59, 0.6);
    --surface-light: rgba(51, 65, 85, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --border: rgba(71, 85, 105, 0.3);
    --glow: rgba(99, 102, 241, 0.3);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    animation: backgroundShift 20s ease infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes backgroundShift {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 0;
    animation: fadeInDown 0.8s ease-out;
}

.logo-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInDown 0.8s ease-out 0.1s both;
}

.logo {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(255, 255, 255, 0.1));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.logo:hover {
    transform: scale(1.05) rotate(2deg);
    filter: drop-shadow(0 8px 30px rgba(255, 255, 255, 0.2));
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    animation: expandLine 1s ease-out 0.5s both;
}

@keyframes expandLine {
    from {
        width: 0;
    }
    to {
        width: 60px;
    }
}

.fivem-logo-container {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInDown 0.8s ease-out 0.2s both;
}

.fivem-logo {
    max-width: 80px;
    height: auto;
    filter: drop-shadow(0 4px 15px rgba(255, 107, 53, 0.4));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.fivem-logo:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 8px 25px rgba(255, 107, 53, 0.6));
}

.subtitle {
    color: var(--text-secondary);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 400;
    margin-top: 1.5rem;
    opacity: 0.9;
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.filter-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.author-note {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    display: inline-block;
    animation: fadeInDown 0.8s ease-out 0.4s both;
}

.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.script-card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.script-card:nth-child(1) { animation-delay: 0.1s; }
.script-card:nth-child(2) { animation-delay: 0.2s; }
.script-card:nth-child(3) { animation-delay: 0.3s; }
.script-card:nth-child(4) { animation-delay: 0.4s; }
.script-card:nth-child(5) { animation-delay: 0.5s; }
.script-card:nth-child(6) { animation-delay: 0.6s; }

.script-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.script-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    pointer-events: none;
    z-index: -1;
}

.script-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: var(--surface-hover);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(99, 102, 241, 0.1),
        0 0 60px rgba(99, 102, 241, 0.15);
}

.script-card:hover::before {
    transform: scaleX(1);
}

.script-card:hover::after {
    width: 300px;
    height: 300px;
}

.card-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1.5rem 2rem 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.created-badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
    color: #10b981;
    padding: 0.375rem 0.875rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.3s ease;
}

.created-badge::before {
    content: '✓';
    font-size: 0.875rem;
    font-weight: 700;
    animation: checkmark 0.5s ease-out 0.3s both;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
    }
}

.script-card:hover .created-badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(5, 150, 105, 0.3) 100%);
    border-color: rgba(16, 185, 129, 0.5);
    transform: scale(1.05);
}

.script-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.3;
    transition: color 0.3s ease;
    padding: 0 2rem;
}

.script-card:hover .script-title {
    color: var(--primary-color);
}

.script-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.7;
    opacity: 0.85;
    padding: 0 2rem;
    flex-grow: 1;
}

.script-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0 2rem;
}

.card-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
    background: rgba(0, 0, 0, 0.1);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.footer-content:has(.fivem-logo-small) {
    justify-content: space-between;
}

.fivem-logo-small {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(255, 107, 53, 0.4));
    transition: all 0.3s ease;
}

.script-card:hover .fivem-logo-small {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(255, 107, 53, 0.6));
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.github-link svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.script-card:hover .github-link {
    color: var(--secondary-color);
}

.script-card:hover .github-link svg {
    transform: translateX(4px);
}

.unavailable-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem;
    opacity: 0.7;
}

.unavailable-badge svg {
    width: 20px;
    height: 20px;
}

.script-card.unavailable {
    cursor: not-allowed;
    opacity: 0.7;
    filter: grayscale(0.3);
}

.script-card.unavailable:hover {
    transform: none;
    box-shadow: none;
}

.script-tag {
    background: var(--surface-light);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.script-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.script-card:hover .script-tag {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.script-card:hover .script-tag::before {
    left: 100%;
}

.script-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    margin-top: 0.5rem;
}

.script-link svg {
    width: 20px;
    height: 20px;
}

footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    margin-top: 5rem;
    opacity: 0.7;
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .container {
        padding: 2rem 1.5rem;
    }

    header {
        padding: 2rem 0;
        margin-bottom: 3rem;
    }

    .logo {
        max-width: 100px;
    }

    .logo-container {
        margin-bottom: 1.5rem;
    }

    .fivem-logo {
        max-width: 60px;
    }

    .fivem-logo-container {
        margin-bottom: 1.25rem;
    }

    .filter-container {
        margin-bottom: 2rem;
        gap: 0.75rem;
    }

    .filter-btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.875rem;
    }

    .author-note {
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }

    .scripts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .script-card {
        border-radius: 20px;
    }

    .card-header {
        padding: 1.25rem 1.5rem 0.75rem;
    }

    .script-title {
        font-size: 1.5rem;
        padding: 0 1.5rem;
    }

    .script-description {
        padding: 0 1.5rem;
    }

    .script-meta {
        padding: 0 1.5rem;
    }

    .card-footer {
        padding: 1.25rem 1.5rem;
    }

    footer {
        margin-top: 3rem;
        padding: 2rem 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem;
    }

    header {
        padding: 1.5rem 0;
    }

    .logo {
        max-width: 80px;
    }

    .logo-container {
        margin-bottom: 1rem;
    }

    .fivem-logo {
        max-width: 50px;
    }

    .fivem-logo-container {
        margin-bottom: 1rem;
    }

    .filter-container {
        margin-bottom: 1.5rem;
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .card-header {
        padding: 1rem 1.25rem 0.75rem;
    }

    .script-title {
        padding: 0 1.25rem;
        font-size: 1.35rem;
    }

    .script-description {
        padding: 0 1.25rem;
        font-size: 0.95rem;
    }

    .script-meta {
        padding: 0 1.25rem;
    }

    .card-footer {
        padding: 1rem 1.25rem;
    }
}
