:root {
    --bg-color: #050505;
    --card-bg: rgba(20, 20, 20, 0.7);
    --accent-color: #00d4ff;
    --accent-glow: rgba(0, 212, 255, 0.5);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.top-actions {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
}

.btn-schedule {
    background: var(--card-bg);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.btn-schedule:hover {
    background: var(--accent-color);
    color: black;
    box-shadow: 0 0 30px var(--accent-glow);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

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

.glitter-text {
    font-size: 4rem;
    font-weight: 600;
    background: linear-gradient(45deg, #fff, var(--accent-color), #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 5s linear infinite;
    letter-spacing: -1px;
}

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

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    gap: 2rem;
}

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 500px;
}

#city-search {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#city-search:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

.search-results {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(25px);
    border-radius: 15px;
    border: 1px solid var(--accent-color);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.search-item {
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

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

.sync-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.sync-indicator {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--card-bg);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-reset {
    background: none;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.3s;
}

.btn-reset:hover {
    background: var(--accent-color);
    color: black;
}

.pulse {
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 10px #4caf50;
    animation: pulseSync 2s infinite;
}

.clocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding-bottom: 5rem;
}

.clock-card {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.4), rgba(10, 10, 10, 0.6));
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
    cursor: grab;
}

.clock-card:active {
    cursor: grabbing;
}

.clock-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    border-color: var(--accent-color);
}

.clock-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 212, 255, 0.1);
}

.remove-city {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s;
}

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

.clock-face {
    width: 180px;
    height: 180px;
    border: 4px solid var(--text-primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    position: relative;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

/* Day/Night Styles */
.clock-face.day {
    background: radial-gradient(circle, rgba(255, 220, 100, 0.2) 0%, rgba(20, 20, 20, 0.1) 70%);
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.clock-face.night {
    background: radial-gradient(circle, rgba(100, 150, 255, 0.1) 0%, rgba(5, 5, 5, 0.5) 70%);
    border-color: #4a90e2;
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.1);
}

.clock-face::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background-image: radial-gradient(circle at center, transparent 69%, var(--text-primary) 70%, transparent 71%);
    background-size: 20px 20px;
    pointer-events: none;
}

/* Schedule Mode Bar */
.schedule-controls-bar {
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.1), rgba(0, 0, 0, 0.5));
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(20px);
    animation: slideDown 0.5s ease-out;
}

.planning-info {
    flex: 1;
}

.badge {
    background: var(--accent-color);
    color: black;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 0 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.input-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.input-group input {
    background: #111;
    border: 1px solid var(--accent-color);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1.1rem;
    transition: 0.3s;
    outline: none;
}

.input-group input:focus {
    box-shadow: 0 0 15px var(--accent-glow);
    background: #222;
}

.arrow {
    font-size: 1.5rem;
    color: var(--accent-color);
    justify-content: center;
}

.btn-exit {
    background: #ff4444;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Clock Card Variations */
.clock-card.primary {
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    animation: primaryPulse 3s infinite;
}

@keyframes primaryPulse {
    0% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.4);
    }

    100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
    }
}

.primary-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--accent-color);
    color: black;
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 800;
    box-shadow: 0 0 10px var(--accent-glow);
}

.range-display {
    margin-top: 1rem;
    background: rgba(0, 212, 255, 0.1);
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px dashed var(--accent-color);
}

.range-display .time-range {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
}

.range-display .date-diff {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.clock-face::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom;
    border-radius: 10px;
    transition: transform 0.1s linear;
    /* Faster transition for dragging */
}

.hand.interactive {
    cursor: pointer;
}

.hand.interactive:hover {
    filter: brightness(1.5);
    box-shadow: 0 0 10px var(--accent-glow);
}

.hand.selected {
    filter: brightness(2);
    box-shadow: 0 0 15px #00ffff, 0 0 30px rgba(0, 255, 255, 0.4);
    z-index: 15;
}

/* Hide seconds in planning mode */
body.planning-mode .second-hand {
    display: none;
}

.hour-hand {
    width: 6px;
    height: 45px;
    background: var(--text-primary);
    margin-left: -3px;
}

.minute-hand {
    width: 4px;
    height: 65px;
    background: var(--text-secondary);
    margin-left: -2px;
}

.second-hand {
    width: 2px;
    height: 75px;
    background: var(--accent-color);
    margin-left: -1px;
}

.city-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.timezone-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.digital-time {
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--accent-color);
    cursor: pointer;
}

.digital-time:hover {
    text-decoration: underline;
}

/* Modal Styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    z-index: 1000;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--accent-color);
    z-index: 1001;
    display: none;
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.modal h3 {
    margin-bottom: 1rem;
}

#edit-time-input {
    background: #333;
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.5rem;
    margin: 1.5rem 0;
    width: 100%;
    text-align: center;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.btn-primary {
    background: var(--accent-color);
    color: black;
}

.btn-secondary {
    background: #444;
    color: white;
}

/* Animations */
@keyframes shine {
    to {
        background-position: 200% center;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseSync {
    0% {
        opacity: 0.5;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    100% {
        opacity: 0.5;
        transform: scale(0.9);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

@media (max-width: 600px) {
    .glitter-text {
        font-size: 2.5rem;
    }

    .controls {
        flex-direction: column;
    }

    .search-wrapper {
        max-width: 100%;
    }
}