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

:root {
    --font-main: 'Space Grotesk', system-ui, sans-serif;
    --font-code: 'JetBrains Mono', monospace;
    --transition-speed: 0.3s;
}

body {
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    position: relative;
    transition: background var(--transition-speed) ease;
}

.app-container.light-mode {
    background: #f0f4f8;
    color: #1a1a2e;
}

.app-container.dark-mode {
    background: #0a0a0f;
    color: #e8e8f0;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    filter: blur(80px);
}

.animated-bg.light {
    background: linear-gradient(135deg, #e8f0fe 0%, #fce4ec 100%);
}

.animated-bg.dark {
    background: linear-gradient(135deg, #0a0a15 0%, #12121f 100%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
    opacity: 0.7;
}

.light .blob-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #ff0080, #ff6b9d);
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.light .blob-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #7928ca, #a855f7);
    top: 20%;
    right: -5%;
    animation-delay: -4s;
}

.light .blob-3 {
    width: 450px;
    height: 450px;
    background: linear-gradient(135deg, #0070f3, #38bdf8);
    bottom: -5%;
    left: 20%;
    animation-delay: -8s;
}

.light .blob-4 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #00dfd8, #34d399);
    bottom: 30%;
    right: 20%;
    animation-delay: -12s;
}

.light .blob-5 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #ff4d4d, #f97316);
    top: 50%;
    left: 10%;
    animation-delay: -16s;
}

.dark .blob-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #be185d, #db2777);
    top: -10%;
    left: -5%;
    animation-delay: 0s;
    opacity: 0.5;
}

.dark .blob-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #5b21b6, #7c3aed);
    top: 20%;
    right: -5%;
    animation-delay: -4s;
    opacity: 0.5;
}

.dark .blob-3 {
    width: 450px;
    height: 450px;
    background: linear-gradient(135deg, #0369a1, #0ea5e9);
    bottom: -5%;
    left: 20%;
    animation-delay: -8s;
    opacity: 0.5;
}

.dark .blob-4 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    bottom: 30%;
    right: 20%;
    animation-delay: -12s;
    opacity: 0.5;
}

.dark .blob-5 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #dc2626, #ea580c);
    top: 50%;
    left: 10%;
    animation-delay: -16s;
    opacity: 0.5;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(50px, -50px) scale(1.1) rotate(5deg);
    }
    50% {
        transform: translate(20px, 50px) scale(0.95) rotate(-3deg);
    }
    75% {
        transform: translate(-30px, 20px) scale(1.05) rotate(3deg);
    }
}

/* Header */
.app-header {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-icon {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #ff0080, #7928ca, #0070f3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.dark-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    padding: 8px 12px;
    border-radius: 30px;
    transition: all var(--transition-speed) ease;
}

.dark-mode .dark-mode-toggle {
    background: rgba(255, 255, 255, 0.1);
}

.light-mode .dark-mode-toggle {
    background: rgba(0, 0, 0, 0.05);
}

.toggle-track {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    position: relative;
    transition: all var(--transition-speed) ease;
}

.light-mode .toggle-track {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
}

.dark-mode .toggle-track {
    background: linear-gradient(135deg, #312e81, #4338ca);
}

.toggle-thumb {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background: white;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-thumb.active {
    left: 22px;
    background: #1e1b4b;
}

.toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Preview Section */
.preview-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 40px;
}

.glass-card-preview {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    transition: all var(--transition-speed) ease;
}

.card-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ff0080, #7928ca);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 24px;
    opacity: 0.9;
}

.card-button {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #7928ca, #ff0080);
    color: white;
    transition: all var(--transition-speed) ease;
}

.card-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(121, 40, 202, 0.4);
}

/* Control Panel */
.control-panel {
    padding: 24px;
    transition: all var(--transition-speed) ease;
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.slider-group {
    margin-bottom: 20px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.slider-label {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.9;
}

.slider-value {
    font-family: var(--font-code);
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(121, 40, 202, 0.15);
}

.styled-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    appearance: none;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.light-mode .styled-slider {
    background: linear-gradient(90deg, rgba(121, 40, 202, 0.2), rgba(255, 0, 128, 0.2));
}

.dark-mode .styled-slider {
    background: linear-gradient(90deg, rgba(121, 40, 202, 0.4), rgba(255, 0, 128, 0.4));
}

.styled-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7928ca, #ff0080);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 8px rgba(121, 40, 202, 0.4);
}

.styled-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(121, 40, 202, 0.6);
}

.styled-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7928ca, #ff0080);
    cursor: pointer;
    border: none;
    transition: all var(--transition-speed) ease;
}

.tint-selector {
    margin-bottom: 24px;
}

.tint-options {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.tint-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.light-mode .tint-btn {
    background: rgba(0, 0, 0, 0.05);
    color: inherit;
}

.dark-mode .tint-btn {
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
}

.tint-btn.active {
    border-color: #7928ca;
    background: linear-gradient(135deg, rgba(121, 40, 202, 0.2), rgba(255, 0, 128, 0.2));
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.action-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.reset-btn {
    background: rgba(100, 100, 100, 0.2);
    color: inherit;
}

.reset-btn:hover {
    background: rgba(100, 100, 100, 0.3);
}

.random-btn {
    background: linear-gradient(135deg, #7928ca, #ff0080);
    color: white;
}

.random-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(121, 40, 202, 0.4);
}

/* Code Section */
.code-section {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 24px;
}

.code-container {
    overflow: hidden;
    transition: all var(--transition-speed) ease;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #a78bfa;
}

.copy-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    background: linear-gradient(135deg, #7928ca, #ff0080);
    color: white;
}

.copy-btn:hover {
    transform: scale(1.05);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.code-block {
    padding: 20px;
    margin: 0;
    overflow-x: auto;
    font-family: var(--font-code);
    font-size: 0.85rem;
    line-height: 1.6;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-word;
}

.browser-note {
    text-align: center;
    font-size: 0.75rem;
    margin-top: 12px;
    opacity: 0.7;
}

/* Footer */
.app-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 20px;
    margin: 20px 24px 24px;
    max-width: calc(1200px - 48px);
    margin-left: auto;
    margin-right: auto;
    font-size: 0.875rem;
}

.app-footer a {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
}

.app-footer a:hover {
    color: #ff0080;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .app-header {
        padding: 16px;
    }

    .app-title {
        font-size: 1.1rem;
    }

    .main-content {
        padding: 16px;
        gap: 24px;
    }

    .preview-section {
        padding: 20px;
        min-height: 300px;
    }

    .glass-card-preview {
        padding: 24px;
    }

    .card-title {
        font-size: 1.4rem;
    }

    .control-panel {
        padding: 20px;
    }

    .code-section {
        padding: 0 16px 16px;
    }

    .code-block {
        font-size: 0.75rem;
    }
}