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

:root {
    --bg-gradient: linear-gradient(135deg, #000000 0%, #121212 100%);
    --petal-color1: #ffd1dc;
    --petal-color2: #fff;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    --glass-blur: blur(12px);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    overflow-x: hidden;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.search-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    position: relative;
    z-index: 100;
}

#city-search {
    width: 100%;
    padding: 1.2rem 2rem;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

#city-search:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.search-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.1);
}


.main-clock-container {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 2rem;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin-bottom: 4rem;
    transition: transform 0.3s ease;
}

.main-clock-container:hover {
    transform: translateY(-5px);
}

.main-time {
    font-size: 6rem;
    font-weight: 700;
    letter-spacing: -2px;
    text-shadow: var(--accent-glow);
}

.main-date {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.world-clocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 1200px;
}

.clock-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.clock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.03), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.clock-card:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
}

.clock-card:hover::before {
    transform: translateX(100%);
}

.city-name {
    font-size: 1.5rem;
    font-weight: 600;
}

.city-time {
    font-size: 2.5rem;
    font-weight: 700;
}

.city-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.city-offset {
    font-size: 0.8rem;
    background: rgba(99, 102, 241, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    width: fit-content;
    color: #a5b4fc;
}

.remove-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    opacity: 0;
}

.clock-card:hover .remove-btn {
    opacity: 1;
}

.remove-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}


@media (max-width: 768px) {
    .main-time {
        font-size: 4rem;
    }
    h1 {
        font-size: 2.2rem;
    }
}

/* Seasonal Effect: Falling Petals */
.bg-effect-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.petal {
    position: absolute;
    background: linear-gradient(to bottom right, var(--petal-color1), var(--petal-color2));
    border-radius: 150% 0 150% 0;
    top: -20px;
    opacity: 0.3;
    animation: fall linear infinite, sway ease-in-out infinite alternate;
}

@keyframes fall {
    to {
        transform: translateY(110vh) rotate(360deg);
    }
}

@keyframes sway {
    0% {
        margin-left: 0;
    }
    100% {
        margin-left: 50px;
    }
}

/* Visitor Counter */
.visitor-counter {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    padding: 0.8rem 1.2rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    z-index: 1000;
    color: var(--text-primary);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    position: relative;
}

.live-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: #10b981;
    border-radius: 50%;
    animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.6;
    }
    100% {
        width: 300%;
        height: 300%;
        opacity: 0;
    }
}
