:root {
    --deep-purple: #1a1a2e;
    --cosmic-blue: #16213e;
    --electric-cyan: #0f3460;
    --bright-green: #00ff9f;
    --accent-cyan: #00d4ff;
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(135deg, var(--deep-purple) 0%, var(--cosmic-blue) 50%, var(--electric-cyan) 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
}

.app-container {
    position: relative;
    min-height: 100vh;
}

.particles-bg {
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(0, 255, 159, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(0, 212, 255, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(0, 255, 159, 0.2), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(0, 212, 255, 0.3), transparent);
    background-size: 200px 200px;
    animation: particleFloat 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes particleFloat {
    from { background-position: 0 0; }
    to { background-position: 200px 200px; }
}

/* Header */
.app-header {
    padding: 1.5rem;
    background: rgba(22, 33, 62, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 255, 159, 0.2);
    position: relative;
    z-index: 10;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--bright-green), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 255, 159, 0.3);
}

.app-tagline {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
}

/* Atom Animation */
.atom-container {
    width: 50px;
    height: 50px;
    position: relative;
}

.nucleus {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--bright-green);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px var(--bright-green);
}

.orbit {
    position: absolute;
    border: 1px solid rgba(0, 255, 159, 0.4);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform-origin: center;
}

.orbit-1 { width: 30px; height: 30px; margin: -15px; animation: orbitSpin 3s linear infinite; }
.orbit-2 { width: 40px; height: 40px; margin: -20px; animation: orbitSpin 4s linear infinite reverse; transform: rotateX(60deg); }
.orbit-3 { width: 50px; height: 50px; margin: -25px; animation: orbitSpin 5s linear infinite; transform: rotateY(60deg); }

.electron {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent-cyan);
    border-radius: 50%;
    top: -3px;
    left: 50%;
    margin-left: -3px;
    box-shadow: 0 0 10px var(--accent-cyan);
}

@keyframes orbitSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 5;
}

/* Glass Card */
.glass-card {
    background: rgba(22, 33, 62, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 159, 0.15);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(0, 255, 159, 0.3);
    box-shadow: 0 8px 32px rgba(0, 255, 159, 0.1);
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Clock Section */
.clock-container {
    text-align: center;
}

.clock-ring-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.clock-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 4;
}

.ring-progress {
    fill: none;
    stroke: url(#gradient);
    stroke: var(--bright-green);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 565;
    transition: stroke-dashoffset 1s ease;
}

.clock-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.time-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    align-items: center;
}

.time-icon {
    font-size: 2rem;
}

.time-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.time-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--bright-green);
}

.time-unit {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Search Section */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.25rem;
    z-index: 1;
}

.search-input {
    flex: 1;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 255, 159, 0.2);
    border-radius: 50px;
    color: white;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--bright-green);
    box-shadow: 0 0 20px rgba(0, 255, 159, 0.2);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-btn {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--bright-green), var(--accent-cyan));
    border: none;
    border-radius: 50px;
    color: var(--deep-purple);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 255, 159, 0.4);
}

.topic-chip {
    padding: 0.5rem 1rem;
    background: rgba(0, 255, 159, 0.15);
    border: 1px solid rgba(0, 255, 159, 0.3);
    border-radius: 20px;
    color: var(--bright-green);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.topic-chip:hover {
    background: rgba(0, 255, 159, 0.3);
    transform: translateY(-2px);
}

.history-chip {
    padding: 0.25rem 0.75rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 15px;
    color: var(--accent-cyan);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.history-chip:hover {
    background: rgba(0, 212, 255, 0.2);
}

/* Knowledge Cards */
.knowledge-card {
    animation: slideUp 0.4s ease-out;
}

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

.highlight-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(0, 255, 159, 0.2), rgba(0, 212, 255, 0.2));
    border: 1px solid rgba(0, 255, 159, 0.3);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--bright-green);
}

.action-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--bright-green);
}

/* Error Card */
.error-card {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

/* Loading Spinner */
.molecule-loader {
    display: flex;
    gap: 8px;
}

.atom-spin {
    width: 16px;
    height: 16px;
    background: var(--bright-green);
    border-radius: 50%;
    animation: atomBounce 0.8s ease-in-out infinite;
}

.atom-spin.delay-1 { animation-delay: 0.1s; background: var(--accent-cyan); }
.atom-spin.delay-2 { animation-delay: 0.2s; background: #c084fc; }

@keyframes atomBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* Timer Section */
.timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.beaker-container {
    margin: 1rem 0;
}

.beaker {
    width: 100px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
}

.beaker::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -10px;
    right: -10px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px 5px 0 0;
}

.beaker-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: height 1s ease;
}

.bubbles {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
}

.bubble {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: bubbleRise 2s ease-in-out infinite;
}

.bubble:nth-child(1) { left: 20%; }
.bubble:nth-child(2) { left: 40%; animation-delay: 0.5s; }
.bubble:nth-child(3) { left: 60%; animation-delay: 1s; }
.bubble:nth-child(4) { left: 80%; animation-delay: 1.5s; }
.bubble:nth-child(5) { left: 50%; animation-delay: 0.3s; }

@keyframes bubbleRise {
    0% { bottom: 0; opacity: 0; }
    50% { opacity: 1; }
    100% { bottom: 100%; opacity: 0; }
}

.beaker-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.phases-display {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.phase-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    opacity: 0.4;
    transition: all 0.3s;
}

.phase-item.active {
    opacity: 1;
}

.phase-item.current {
    transform: scale(1.1);
}

.phase-item.current .phase-icon {
    animation: pulse 1s ease-in-out infinite;
}

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

.phase-icon {
    font-size: 1.5rem;
}

.phase-name {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timer-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

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

.duration-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.duration-btn.active {
    background: var(--bright-green);
    color: var(--deep-purple);
    border-color: var(--bright-green);
}

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

.primary-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--bright-green), var(--accent-cyan));
    border: none;
    border-radius: 25px;
    color: var(--deep-purple);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 255, 159, 0.4);
}

.secondary-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    border-color: var(--bright-green);
}

/* Daily Section */
.feature-card {
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.feature-label {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.feature-text {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.refresh-btn {
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: transform 0.3s;
}

.refresh-btn:hover {
    transform: rotate(180deg);
}

/* Ticker */
.ticker-container {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background: rgba(22, 33, 62, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.75rem;
    border-top: 1px solid rgba(0, 255, 159, 0.2);
    z-index: 100;
    overflow: hidden;
}

.ticker-content {
    text-align: center;
    color: var(--bright-green);
    font-size: 0.9rem;
    animation: tickerFade 5s ease-in-out;
}

@keyframes tickerFade {
    0%, 100% { opacity: 0; transform: translateY(10px); }
    10%, 90% { opacity: 1; transform: translateY(0); }
}

/* Footer */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(0, 255, 159, 0.1);
    z-index: 101;
}

.footer-pun {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.footer-links {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.remix-link {
    color: var(--bright-green);
    text-decoration: none;
    transition: color 0.2s;
}

.remix-link:hover {
    color: var(--accent-cyan);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .app-title {
        font-size: 1.5rem;
    }
    
    .clock-ring-container {
        width: 160px;
        height: 160px;
    }
    
    .time-card {
        flex-direction: column;
        text-align: center;
    }
    
    .main-content {
        padding-bottom: 140px;
    }
    
    .phases-display {
        gap: 0.25rem;
    }
    
    .phase-item {
        padding: 0.25rem;
    }
    
    .phase-icon {
        font-size: 1.25rem;
    }
    
    .phase-name {
        font-size: 0.6rem;
    }
}