/* City Clock Custom Element Styles */

city-clock {
    display: block;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0c1445 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

/* Hide scrollbars */
city-clock::-webkit-scrollbar {
    display: none;
}

city-clock {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Compact mode when map is hidden */
city-clock[hide-map] {
    min-height: auto;
    padding-bottom: 20px;
}

/* Ensure minimum height when both map and clocks are hidden for sidebar access */
city-clock[hide-map][hide-clocks] {
    min-height: 60px;
}

city-clock .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

city-clock header {
    text-align: center;
    padding: 30px 0;
}

city-clock h1.dashboard-title {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
    margin: 0;
    padding-left: 50px;
}

@keyframes shimmer {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
}

city-clock .main-time {
    font-size: 5rem;
    font-weight: 100;
    letter-spacing: 4px;
    margin-top: 10px;
    font-variant-numeric: tabular-nums;
}

city-clock .main-date {
    font-size: 1.2rem;
    opacity: 0.7;
    letter-spacing: 3px;
}

city-clock .map-container {
    position: relative;
    margin: 40px auto;
    max-width: 1200px;
}

city-clock .us-map {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 30px rgba(72, 219, 251, 0.3));
}

city-clock .us-map path {
    fill: #1e3a5f;
    stroke: #48dbfb;
    stroke-width: 0.5;
    transition: all 0.3s ease;
}

city-clock .us-map path:hover {
    fill: #2d5a87;
    filter: brightness(1.2);
}

city-clock .us-map path.day {
    fill: #3d7ea6;
}

city-clock .us-map path.twilight {
    fill: #5c4d7d;
}

city-clock .us-map path.night {
    fill: #1a2744;
}

city-clock .us-map path.dimmed {
    opacity: 0.2;
}

city-clock .us-map path.highlighted {
    filter: brightness(1.4);
    stroke: #fff;
    stroke-width: 1.5;
}

city-clock .terminator-line {
    stroke: #feca57;
    stroke-width: 3;
    fill: none;
    filter: drop-shadow(0 0 10px #feca57);
    animation: pulse 2s ease-in-out infinite;
}

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

city-clock .city-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
}

city-clock .city-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #48dbfb 100%);
    box-shadow: 0 0 15px #48dbfb, 0 0 30px rgba(72, 219, 251, 0.5);
    animation: glow 2s ease-in-out infinite;
}

city-clock .city-dot.sunrise {
    background: radial-gradient(circle, #fff 0%, #feca57 100%);
    box-shadow: 0 0 15px #feca57, 0 0 30px rgba(254, 202, 87, 0.5);
}

city-clock .city-dot.sunset {
    background: radial-gradient(circle, #fff 0%, #ff6b6b 100%);
    box-shadow: 0 0 15px #ff6b6b, 0 0 30px rgba(255, 107, 107, 0.5);
}

city-clock .city-star {
    width: 20px;
    height: 20px;
    color: #ffd700;
    filter: drop-shadow(0 0 8px #ffd700);
    animation: glow 2s ease-in-out infinite;
}

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

city-clock .city-label {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

city-clock .city-marker:hover .city-label {
    opacity: 1;
}

city-clock .time-zones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

city-clock .zone-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

city-clock .zone-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

city-clock .zone-name {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.7;
    margin-bottom: 5px;
}

city-clock .zone-time {
    font-size: 2.5rem;
    font-weight: 200;
    font-variant-numeric: tabular-nums;
}

city-clock .zone-city {
    font-size: 1.1rem;
    margin-top: 5px;
    opacity: 0.9;
}

city-clock .sun-info {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

city-clock .sun-event {
    display: flex;
    align-items: center;
    gap: 8px;
}

city-clock .sun-icon {
    font-size: 1.2rem;
}

city-clock .sun-icon.sunrise {
    color: #feca57;
}

city-clock .sun-icon.sunset {
    color: #ff6b6b;
}

city-clock .sun-time {
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

city-clock .countdown {
    font-size: 0.75rem;
    opacity: 0.6;
}

city-clock .legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
}

city-clock .legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s;
}

city-clock .legend-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

city-clock .legend-item.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(72, 219, 251, 0.3);
}

city-clock .legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

city-clock .legend-color.day { background: #3d7ea6; }
city-clock .legend-color.twilight { background: #5c4d7d; }
city-clock .legend-color.night { background: #1a2744; }

city-clock .legend-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: 8px;
}

city-clock .wake-lock-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

city-clock .wake-lock-status:hover {
    background: rgba(0,0,0,0.9);
}

city-clock .wake-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff6b6b;
}

city-clock .wake-indicator.active {
    background: #2ecc71;
    box-shadow: 0 0 10px #2ecc71;
}

city-clock .stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

city-clock .star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Sidebar Menu */
city-clock .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 220px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    padding-top: 60px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

city-clock .sidebar.open {
    transform: translateX(0);
}

city-clock .sidebar-item {
    width: 100%;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

city-clock .sidebar-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

city-clock .sidebar-item.active {
    background: rgba(72, 219, 251, 0.2);
    border-left: 3px solid #48dbfb;
}

city-clock .sidebar-icon {
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

city-clock .sidebar-label {
    opacity: 1;
    font-size: 0.9rem;
}

city-clock .sidebar-divider {
    width: 80%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

city-clock .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

city-clock .toggle-switch {
    min-width: 40px;
    width: 40px;
    height: 20px;
    background: #444;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    margin-right: 10px;
    flex-shrink: 0;
}

city-clock .toggle-switch.active {
    background: #48dbfb;
}

city-clock .toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
}

city-clock .toggle-switch.active::after {
    left: 22px;
}

/* Sidebar enabled - no margin needed since it slides over */
city-clock[sidebar] .container {
    margin-left: 0;
}

/* Hide sidebar when not enabled */
city-clock:not([sidebar]) .sidebar {
    display: none;
}

/* Hide wake lock status when not enabled */
city-clock:not([wake-lock]) .wake-lock-status {
    display: none;
}

/* Sidebar toggle button - always visible */
city-clock .sidebar-toggle-btn {
    display: block;
    position: fixed;
    top: 10px;
    left: 10px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    z-index: 1000;
    padding: 8px;
    touch-action: manipulation;
}

city-clock .sidebar-toggle-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: #fff;
    margin: 4px auto;
    transition: transform 0.3s, opacity 0.3s;
    border-radius: 2px;
}

city-clock .sidebar-toggle-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

city-clock .sidebar-toggle-btn.active span:nth-child(2) {
    opacity: 0;
}

city-clock .sidebar-toggle-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Overlay when sidebar is open */
city-clock .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

city-clock .sidebar-overlay.active {
    display: block;
}
