/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Theme Colors */
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #4facfe;
    --warning-color: #f6d365;
    --danger-color: #ff6b6b;
    --text-primary: #111111; /* near black text for readability on white */
    --text-secondary: #4a5568;
    --bg-primary: #ffffff; /* true white */
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --page-background: var(--bg-primary);

    /* Mystic Earth Palette */
    --moss-green: #667C4F;   /* Moss Green */
    --clay-orange: #C47135;  /* Clay Orange */
    --misty-blue: #7BA4A8;   /* Misty Blue */
    --charcoal-brown: #3E2C27; /* Charcoal Brown */
    --pale-sand: #E5D4B1;    /* Pale Sand */
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #4facfe;
    --warning-color: #f6d365;
    --danger-color: #ff6b6b;
    --text-primary: #f5f5f5;
    --text-secondary: #cbd5e0;
    --bg-primary: #000000; /* true black */
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --border-color: #2d2d2d;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    --page-background: var(--bg-primary);
}

/* Remove extra themes for a clean look: stick to light/dark only */

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    background: linear-gradient(45deg, var(--accent-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s infinite;
}

.logo h1 {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(45deg, var(--accent-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.theme-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.theme-btn i {
    font-size: 1.2rem;
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr;
}

/* Step Card */
.step-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--success-color), var(--primary-color));
    animation: shimmer 3s infinite;
}

.step-card:hover {
    transform: translateY(-8px) rotateX(6deg) rotateY(-6deg);
}

.step-display {
    position: relative;
    margin-bottom: 40px;
}

.step-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2), inset 0 6px 20px rgba(255,255,255,0.08);
    animation: float 3s ease-in-out infinite;
    transform: translateZ(40px);
}

.step-circle::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 12px;
    width: 40%;
    height: 40%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5), transparent 60%);
    filter: blur(2px);
}

.step-number {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.step-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    letter-spacing: 2px;
    margin-top: 5px;
}

.progress-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.progress-ring-svg {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    fill: none;
    stroke: var(--accent-color);
    stroke-width: 8;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 0.5s ease;
    filter: drop-shadow(0 0 10px rgba(240, 147, 251, 0.5));
}

/* Step Controls */
.step-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(135deg, #1e3a8a, #2563eb); /* deep indigo to blue */
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    min-width: 120px;
    justify-content: center;
}

.control-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pause-btn {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6); /* medium blue */
}

.reset-btn {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8); /* cyan-blue */
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    transform-style: preserve-3d;
}

.stat-card:hover {
    transform: translateY(-6px) translateZ(20px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, var(--danger-color), #e74c3c);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, var(--success-color), #00b4db);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, var(--warning-color), #f39c12);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

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

/* Goal Progress */
.goal-progress {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

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

.goal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.goal-percentage {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.goal-bar {
    width: 100%;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.goal-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--success-color));
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.goal-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

/* Achievements */
.achievements {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.achievements h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.badges-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.badge {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    opacity: 0.5;
}

.badge.unlocked {
    background: linear-gradient(135deg, var(--accent-color), var(--success-color));
    color: white;
    opacity: 1;
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
    animation: celebration 0.6s ease;
}

.badge i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.badge span {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Settings */
.settings {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.settings h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.setting-item label {
    font-weight: 500;
    color: var(--text-primary);
}

.setting-item input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    width: 120px;
    text-align: center;
}

.setting-item input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 30px;
}

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

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

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .step-card {
        padding: 30px 20px;
    }
    
    .step-circle {
        width: 150px;
        height: 150px;
    }
    
    .step-number {
        font-size: 2.5rem;
    }
    
    .step-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .badges-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .setting-item {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .setting-item input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .step-circle {
        width: 120px;
        height: 120px;
    }
    
    .step-number {
        font-size: 2rem;
    }
    
    .badges-container {
        grid-template-columns: 1fr;
    }
}
