:root {
    /* Light Theme Colors */
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(255, 255, 255, 0.4);
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: #cbd5e1;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --error-color: #ef4444;
    --success-color: #10b981;
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-glow: radial-gradient(circle, rgba(59,130,246,0.15) 0%, rgba(139,92,246,0.15) 100%);
}

.dark-theme {
    /* Dark Theme Colors */
    --bg-color: #0b0f19;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.4);
    --card-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --gradient-glow: radial-gradient(circle, rgba(59,130,246,0.1) 0%, rgba(139,92,246,0.1) 100%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    position: relative;
}

/* Background Glow Effects */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.6;
}

.bg-glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 70%);
}

.bg-glow-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%);
}

/* Typography */
h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navbar */
.navbar {
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
}

.logo i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

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

.nav-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

.btn-icon {
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.btn-icon:hover {
    background: rgba(148, 163, 184, 0.1);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-text {
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.5rem 1rem;
}

.btn-text:hover {
    text-decoration: underline;
}

/* Main Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    flex-grow: 1;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Glass Card Component */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
}

.main-card {
    max-width: 600px;
    margin: 0 auto 4rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Input Group */
.input-group {
    margin-bottom: 2.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 4rem 1rem 3rem;
    border-radius: 0.75rem;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-wrapper .btn-text {
    position: absolute;
    right: 0.5rem;
}

.error-msg {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
}

.error-msg.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Code Display Area */
.code-display-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: rgba(0,0,0,0.05);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--card-border);
}

.dark-theme .code-display-wrapper {
    background: rgba(0,0,0,0.2);
}

/* Progress Ring Timer */
.progress-ring-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-ring__circle {
    transition: stroke-dashoffset 1s linear;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.time-left {
    position: absolute;
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.time-left.warning {
    color: var(--error-color);
    animation: pulse 1s infinite;
}

/* Code Output */
.code-output-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.code-output {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.2rem;
    color: var(--text-primary);
    transition: opacity 0.3s ease;
}

.code-output.expired {
    opacity: 0.5;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.feature-card {
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: inline-block;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Content Section (SEO Text) */
.content-section {
    padding: 3rem;
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.content-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.content-section h2:first-child {
    margin-top: 0;
}

.content-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--card-border);
    margin-top: auto;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Banner Ad */
.banner-ad-container {
    width: 100%;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.banner-ad {
    width: 100%;
    max-width: 728px; /* Standard leaderboard ad width */
    height: 90px; /* Standard leaderboard ad height */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 1px dashed var(--input-border);
    background: rgba(0,0,0,0.02);
    padding: 0;
}

.dark-theme .banner-ad {
    background: rgba(255,255,255,0.02);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .code-display-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .code-output-container {
        align-items: center;
    }
    
    .code-output {
        font-size: 2rem;
    }
    
    .content-section {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .glass-card {
        padding: 1.5rem;
    }
}
