:root {
    --bg-dark: #09090b;
    --panel-bg: rgba(24, 24, 27, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    --accent-primary: #06b6d4; /* Cyan */
    --accent-secondary: #8b5cf6; /* Violet */
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    
    --success: #10b981;
    --danger: #ef4444;
    
    --glass-blur: blur(16px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    position: relative;
    padding: 2rem 1rem;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float 20s infinite alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-secondary);
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: #3b82f6;
    top: calc(50% - 150px);
    left: calc(50% - 150px);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
}

.stats-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.app-header {
    text-align: center;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInDown 0.7s var(--ease-spring) forwards;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-size: 2.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
}

h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Glass Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.calculator-panel {
    animation: fadeInUp 0.7s var(--ease-spring) 0.1s forwards;
    opacity: 0;
    transform: translateY(30px);
}

.live-stats-panel {
    animation: fadeInUp 0.7s var(--ease-spring) 0.2s forwards;
    opacity: 0;
    transform: translateY(30px);
}

/* Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.input-row {
    display: flex;
    gap: 1.5rem;
}

.input-group.half {
    flex: 1;
}

label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

label i {
    color: var(--accent-primary);
}

.input-wrapper {
    position: relative;
}

input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

input:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.focus-border {
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.4s ease;
    border-radius: 2px;
}

input:focus + .focus-border {
    width: calc(100% - 24px);
}

small {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: -0.2rem;
}

/* Quick Presets */
.quick-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.preset-btn.active {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Advanced Settings Toggle */
.advanced-settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.setting-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    background: var(--accent-gradient);
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.setting-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: var(--accent-gradient);
    border-color: transparent;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Button */
.primary-btn {
    width: 100%;
    padding: 1.2rem;
    border: none;
    border-radius: 12px;
    background: var(--accent-gradient);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
    box-shadow: 0 10px 20px -10px var(--accent-primary);
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: var(--transition);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px var(--accent-secondary);
}

.primary-btn:hover::before {
    opacity: 1;
}

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

/* Results Panel */
.scripts-panel {
    transition: var(--transition);
}

.scripts-panel.hidden {
    display: none;
    opacity: 0;
}

.scripts-panel.visible {
    display: block;
    animation: fadeInUp 0.6s ease-out forwards;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    opacity: 0;
    animation: fadeInUp 0.6s var(--ease-spring) forwards;
}

.stat-card:nth-child(1) { animation-delay: 0.3s; }
.stat-card:nth-child(2) { animation-delay: 0.4s; }
.stat-card:nth-child(3) { animation-delay: 0.5s; }
.stat-card:nth-child(4) { animation-delay: 0.6s; }

.stat-card:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Quality Indicators */
.quality-card {
    border-top: 2px solid transparent;
}
.quality-low {
    color: var(--danger) !important;
}
.quality-standard {
    color: var(--accent-primary) !important;
}
.quality-premium {
    color: var(--success) !important;
}

/* Script Section */
.script-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.script-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.script-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.script-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.code-wrapper {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

/* Custom Scrollbar for code-wrapper */
.code-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.code-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.code-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.code-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #a5b4fc;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .input-row {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .glass-panel {
        padding: 1.5rem;
    }
}
