@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap');

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

:root {
    --primary: #7C3AED;
    --secondary: #3B82F6;
    --accent: #EC4899;
    --bg: #FAFAFA;
    --card-bg: #FFFFFF;
    --text: #3C3C3C;
    --text-muted: #6B7280;
    --border: #E5E7EB;
}

body.dark {
    --primary: #C4B5FD;
    --secondary: #93C5FD;
    --accent: #F9A8D4;
    --bg: #0F172A;
    --card-bg: #1E293B;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --border: #334155;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s, color 0.3s;
}

header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.theme-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: transform 0.3s;
    color: var(--text);
}

.theme-btn:hover {
    transform: scale(1.1);
}

body.dark .sun-icon {
    display: block;
}

body.dark .moon-icon {
    display: none;
}

body:not(.dark) .sun-icon {
    display: none;
}

body:not(.dark) .moon-icon {
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.container-small {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.landing-main, .timer-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease-out;
}

.title-gradient {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

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

.subtitle-small {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.feature-card, .evolution-card, .timer-card, .sounds-card {
    border-radius: 1.5rem;
    padding: 3px;
    animation: fadeInUp 0.6s ease-out;
    transition: transform 0.3s;
}

.rainbow-border {
    background: linear-gradient(90deg, 
        #C4B5FD 0%, 
        #F9A8D4 25%, 
        #93C5FD 50%, 
        #86EFAC 75%, 
        #C4B5FD 100%);
    background-size: 200% 200%;
    animation: rainbowMove 3s linear infinite;
}

@keyframes rainbowMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.feature-content, .evolution-content, .timer-content, .sounds-content {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 2rem;
    height: 100%;
}

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

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.purple-gradient {
    background: linear-gradient(135deg, #C4B5FD 0%, #F9A8D4 100%);
}

.blue-gradient {
    background: linear-gradient(135deg, #93C5FD 0%, #86EFAC 100%);
}

.pink-gradient {
    background: linear-gradient(135deg, #F9A8D4 0%, #C4B5FD 100%);
}

.feature-card h3, .evolution-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-align: center;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    text-align: center;
}

.evolution-title {
    text-align: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

.evolution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1.5rem;
}

.evolution-stage {
    text-align: center;
}

.pet-container {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(196, 181, 253, 0.1) 100%);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.evolution-stage p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cta-container {
    text-align: center;
    margin-top: 3rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 3rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 10px 30px rgba(196, 181, 253, 0.3);
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(196, 181, 253, 0.4);
}

.timer-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pet-display {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.mode-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-weight: 500;
    font-family: 'Quicksand', sans-serif;
    transition: all 0.3s;
    border: 2px solid var(--border);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(196, 181, 253, 0.3);
}

.mode-btn:not(.active):hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

.timer-display {
    font-size: 6rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 2rem 0;
    font-variant-numeric: tabular-nums;
}

.timer-display.running {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.cycles-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.control-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.control-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    box-shadow: 0 10px 25px rgba(196, 181, 253, 0.3);
}

.control-btn.primary:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(196, 181, 253, 0.4);
}

.control-btn.secondary {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
}

.control-btn.secondary:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

.sounds-card {
    margin-top: 2rem;
}

.sounds-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sounds-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.25rem;
    font-weight: 600;
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    color: var(--text);
    transition: transform 0.3s;
}

.icon-btn:hover {
    transform: scale(1.1);
}

.volume-slider {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

.sounds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.sound-btn {
    padding: 1rem;
    border-radius: 1rem;
    border: 2px solid var(--border);
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    color: var(--text);
    font-family: 'Quicksand', sans-serif;
}

.sound-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.sound-btn:hover .sound-icon {
    transform: scale(1.15);
}

.sound-btn:hover {
    border-color: var(--primary);
}

.sound-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(196, 181, 253, 0.3);
}

.sound-btn.active .sound-icon {
    transform: scale(1.15);
}

.sound-btn span {
    font-size: 0.75rem;
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 1.5rem;
    width: 90%;
    max-width: 400px;
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

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

.setting-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    font-family: 'Quicksand', sans-serif;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: right;
}

.btn-save {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    transition: transform 0.3s;
}

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

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
}

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

@media (max-width: 768px) {
    .title-gradient {
        font-size: 3rem;
    }
    
    .timer-display {
        font-size: 4rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .evolution-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .sounds-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .sounds-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
