/* Modern CSS Reset & Custom Variables */
:root {
    --bg-gradient: radial-gradient(circle at 0% 0%, #1e1b4b 0%, #0f172a 50%, #020617 100%);
    --accent-primary: #6366f1;
    --accent-secondary: #06b6d4;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    
    --card-bg: rgba(15, 23, 42, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(99, 102, 241, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px 0 rgba(99, 102, 241, 0.1);
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background decorative blobs */
body::before, body::after {
    content: "";
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.25;
    pointer-events: none;
}

body::before {
    background: var(--accent-primary);
    top: 15%;
    left: 10%;
    animation: float 20s infinite ease-in-out alternate;
}

body::after {
    background: var(--accent-secondary);
    bottom: 15%;
    right: 10%;
    animation: float 25s infinite ease-in-out alternate-reverse;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 30px) scale(1.1); }
}

/* Container & Layout */
.app {
    width: 100%;
    max-width: 1100px;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Header */
.header {
    margin-bottom: 2.5rem;
    animation: fadeInDown 0.8s ease-out;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    width: 2rem;
    height: 2rem;
    color: var(--accent-secondary);
    animation: pulseGlow 3s infinite ease-in-out;
}

.title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #fff 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Connection Status Badge */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-warning);
    display: inline-block;
}

.connection-status.connected .status-dot {
    background-color: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
    animation: pulseDot 2s infinite;
}

.connection-status.connecting .status-dot {
    background-color: var(--accent-warning);
    box-shadow: 0 0 8px var(--accent-warning);
    animation: pulseDot 1.5s infinite;
}

.connection-status.disconnected .status-dot {
    background-color: var(--accent-danger);
    box-shadow: 0 0 8px var(--accent-danger);
}

.status-text {
    color: var(--text-secondary);
}

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

/* Main Grid Layout */
.main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

@media (min-width: 768px) {
    .main {
        grid-template-columns: 350px 1fr;
    }
}

/* Glassmorphic Card Styling */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.4s ease, 
                box-shadow 0.4s ease;
}

/* Time Card specifics */
.time-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 320px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 27, 75, 0.4) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.time-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.card-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--accent-secondary);
}

.card-title-group {
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.progress-display {
    display: flex;
    flex-direction: column;
    margin: auto 0;
}

.progress-main {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
    line-height: 1.1;
    margin-bottom: 1.25rem;
    text-align: center;
}

.progress-details {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.progress-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
    transition: background 0.3s ease;
}

.progress-detail-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.time-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1.5rem;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    border-radius: 3px;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

/* Weather Grid */
.weather-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .weather-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.weather-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.weather-card:hover {
    transform: translateY(-4px);
    border-color: var(--card-border-hover);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.05);
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.25rem 0;
}

.weather-temp {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.weather-condition-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.weather-condition {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
}

.weather-icon-img {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    object-fit: contain;
    transition: transform 0.3s ease;
}

.weather-card:hover .weather-icon-img {
    transform: scale(1.15) rotate(5deg);
}

/* Weather Details Grid */
.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
    transition: background 0.3s ease;
}

.weather-card:hover .detail-item {
    background: rgba(255, 255, 255, 0.04);
}

.detail-icon {
    width: 1.15rem;
    height: 1.15rem;
    color: var(--accent-secondary);
    flex-shrink: 0;
}

.detail-info {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.detail-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.weather-updated {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 1rem;
}

/* Footer styling */
.footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeIn 1s ease-out;
}

.footer a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.version {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes pulseGlow {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(6, 182, 212, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.8)); }
}

/* Responsive Overrides */
@media (max-width: 480px) {
    .app {
        padding: 1rem 1rem;
    }
    
    .title {
        font-size: 1.25rem;
    }
    
    .time-main {
        font-size: 2.75rem;
    }
    
    .weather-temp {
        font-size: 2.5rem;
    }
}
