:root {
    --bg-gradient-1: #ff9a9e;
    --bg-gradient-2: #fad0c4;
    --bg-gradient-3: #fad0c4;
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --dock-bg: rgba(255, 255, 255, 0.2);
    --accent-color: #007aff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    overflow: hidden;
    background: #0f2027;
    /* Fallback */
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Dynamic Mesh Gradient Background */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-size: 200% 200%;
    animation: gradientMove 15s ease infinite;
}

.background-mesh::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(100, 200, 255, 0.1) 0%, transparent 60%),
        radial-gradient(circle, rgba(200, 50, 100, 0.1) 0%, transparent 40%);
    animation: rotateMesh 20s linear infinite;
    mix-blend-mode: overlay;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes rotateMesh {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Glass Panel Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
}

/* Main Container */
.app-container {
    width: 90%;
    max-width: 1000px;
    height: 60vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    /* For 3D transitions */
}

/* Views */
.view {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95) translateY(20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 40px;
}

.view.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateY(0);
}

/* Clock View Styling */
.clock-display {
    text-align: center;
}

.time-large {
    font-size: 120px;
    font-weight: 200;
    letter-spacing: -4px;
    line-height: 1;
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.7) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
}

.date-large {
    font-size: 28px;
    font-weight: 400;
    margin-top: 10px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.greeting {
    font-size: 18px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    opacity: 0.8;
}

/* Weather View Styling */
.weather-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.weather-icon-large {
    font-size: 80px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.4));
}

.weather-temp {
    font-size: 80px;
    font-weight: 200;
    letter-spacing: -2px;
}

.weather-desc {
    font-size: 24px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.weather-details {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.6;
}

.detail-value {
    font-size: 18px;
    font-weight: 600;
}

/* Timer View Styling */
.timer-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-circle-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.timer-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.timer-circle-progress {
    fill: none;
    stroke: var(--accent-color);
    stroke-width: 8;
    stroke-dasharray: 880;
    /* 2 * PI * 140 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px var(--accent-color));
}

.timer-display {
    position: absolute;
    text-align: center;
}

.timer-time {
    font-size: 60px;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
}

.timer-controls {
    margin-top: 15px;
    display: flex;
    gap: 15px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.btn-icon:active {
    transform: scale(0.95);
}

/* Dock Styling */
.dock-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dock-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    padding: 12px 20px;
    border-radius: 24px;
    display: flex;
    gap: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dock-item {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 24px;
    color: white;
    position: relative;
    overflow: hidden;
}

.dock-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.dock-item:hover {
    transform: translateY(-8px) scale(1.15);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.dock-item:hover::before {
    opacity: 1;
}

.dock-item.active {
    background: var(--text-primary);
    color: #333;
}

.dock-item.active .icon {
    /* Slightly darker for contrast on white */
    filter: none;
}

/* Tooltip for dock */
.dock-item::after {
    content: attr(data-label);
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.dock-item:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .time-large {
        font-size: 80px;
    }

    .app-container {
        height: 70vh;
        width: 95%;
    }

    .dock-container {
        padding: 10px 15px;
        bottom: 20px;
    }

    .dock-item {
        width: 48px;
        height: 48px;
    }

    .weather-temp {
        font-size: 60px;
    }
}