:root {
    --bg-main: #0a0a0c;
    --bg-card: #15151a;
    --bg-nav: rgba(10, 10, 12, 0.8);
    --primary: #10b981; /* Toxic Green */
    --primary-hover: #059669;
    --accent: #3b82f6; /* Electric Blue */
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --border-color: #26262c;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-main);
}

.logo i {
    color: var(--primary);
}

.logo span {
    color: var(--accent);
}

/* Removed search bar from navbar */

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: white;
}

/* Nav Search Bar (Appears on Scroll) */
.nav-search {
    flex: 1;
    max-width: 450px;
    margin: 0 2rem;
    position: relative;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: none;
}

@media (min-width: 768px) {
    .nav-search {
        display: flex;
        align-items: center;
    }
}

.nav-search.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.nav-search i.fa-search {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.nav-search input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}

.nav-search input:focus {
    border-color: var(--primary-accent);
}

.nav-search-keys {
    position: absolute;
    right: 0.5rem;
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.nav-search-keys i, .nav-search-keys span {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Hero Section Search Bar */
.hero {
    margin-top: 80px;
    padding: 6rem 2rem 4rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.hero-search-container {
    width: 100%;
    max-width: 650px;
}

.main-search-bar {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: #1c1c21;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    transition: all 0.3s ease;
}

.main-search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

.main-search-bar .search-icon {
    position: absolute;
    left: 1.2rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.main-search-bar input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.8rem 1rem 0.8rem 3rem;
    color: white;
    font-size: 1rem;
    outline: none;
}

.main-search-bar input::placeholder {
    color: #6b7280;
}

.main-search-bar .search-btn {
    background: #2a2a32;
    color: var(--text-muted);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 4px;
}

.main-search-bar .search-btn:hover {
    background: #3f3f4a;
    color: white;
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.hero-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.stat-num {
    color: white;
    font-weight: 700;
}

.online-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* Container & Grid */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem 2rem;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title h2 i {
    color: var(--warning);
}

.filter-btns {
    display: flex;
    gap: 0.5rem;
}

.filter-btns button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btns button:hover, .filter-btns button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Cards */
.script-card {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.script-card:hover {
    transform: translateY(-3px);
}

.card-image {
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s;
}

.script-card:hover .card-image {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border-color: rgba(138, 43, 226, 0.4);
}

/* Badges on Image */
.badge-views, .badge-time, .badge-rating {
    position: absolute;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 5px;
}

.badge-views { top: 8px; left: 8px; }
.badge-time { top: 8px; right: 8px; }
.badge-rating { bottom: 8px; right: 8px; color: #00f2fe; }

.card-content {
    padding: 12px 0 0 0;
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.card-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.game-tag-pill {
    background: #5b5fc7;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.script-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    line-height: 1.3;
    margin: 2px 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.author-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.verified {
    color: #3b82f6;
    font-size: 0.8rem;
}

.comments-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-header {
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(138, 43, 226, 0.1) 0%, transparent 100%);
}

.modal-game-tag {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.modal-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.keyless-badge {
    background: rgba(138, 43, 226, 0.2);
    color: #d8b4fe;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

.modal-body {
    padding: 2rem;
}

.code-preview {
    background: #0d0d10;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    margin-bottom: 1.5rem;
}

.code-header {
    background: #1a1a20;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.code-preview pre {
    padding: 1.5rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: #e5e7eb;
    overflow-x: auto;
}

.blur-overlay {
    position: absolute;
    inset: 0;
    top: 36px;
    background: rgba(13, 13, 16, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.lock-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

.features-list h4 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.features-list h4 i {
    color: var(--warning);
}

.features-list ul {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.features-list li {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.features-list li::before {
    content: '→';
    color: var(--primary);
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    text-align: center;
}

.btn-large {
    font-size: 1.1rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

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

.safe-text i {
    color: var(--success);
}

/* Loading Overlay (Locker Sequence) - FULL SCREEN GLASSMORPHISM */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 6, 0.85); /* Darker base */
    backdrop-filter: blur(35px); /* Massive blur */
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem 0;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loading-box {
    text-align: center;
    max-width: 800px;
    width: 90%;
    padding: 20px 10px;
    margin: 0 auto; /* Horizontal center only, fixes vertical cutoff bug */
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(138, 43, 226, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-box h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.loading-box p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    transition: width 0.3s ease;
}

.loading-steps {
    text-align: left;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.step {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: color 0.3s;
}

.step:last-child {
    margin-bottom: 0;
}

.step.active {
    color: var(--text-main);
    font-weight: 500;
}

.step.completed {
    color: var(--success);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-content { padding: 1rem; flex-wrap: wrap; }
    .search-bar { order: 3; width: 100%; margin-top: 1rem; max-width: none; }
    .hero h1 { font-size: 2.5rem; }
    .features-list ul { grid-template-columns: 1fr; }
    .modal-body { padding: 1.5rem; }
    .modal-header { padding: 1.5rem 1.5rem 1rem; }
    .modal-footer { padding: 1.5rem; }
}
