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

:root {
    --background: #FFFBF0;
    --foreground: #1B3A3A;
    --primary: #0D9488;
    --primary-light: #14B8A6;
    --muted: #D5E8E8;
    --accent: #FBBF24;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Page Management */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.1;
    }
}

@keyframes pulseSecondary {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.2;
    }
}

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

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

.slide-left {
    animation: slideLeft 0.6s ease-out forwards;
}

.slide-right {
    animation: slideRight 0.6s ease-out forwards;
}

/* Login & Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: linear-gradient(to bottom, #FFFBF0 0%, #D5E8E8 100%);
}

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

.app-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.auth-subtitle {
    color: var(--foreground);
    opacity: 0.7;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--white);
    border: 2px solid transparent;
    border-radius: 1rem;
    font-size: 1rem;
    color: var(--foreground);
    transition: border-color 0.3s ease;
}

.input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px var(--shadow);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.link {
    color: var(--foreground);
    opacity: 0.6;
    text-decoration: none;
    font-size: 0.875rem;
    transition: opacity 0.3s ease;
}

.link:hover {
    opacity: 1;
}

/* Onboarding */
.onboarding-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    background: linear-gradient(to bottom, #FFFBF0 0%, #D5E8E8 100%);
}

.onboarding-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.progress-indicators {
    display: flex;
    gap: 0.5rem;
}

.progress-dot {
    height: 4px;
    width: 8px;
    background: var(--muted);
    border-radius: 2px;
    transition: all 0.5s ease;
}

.progress-dot.active {
    width: 32px;
    background: var(--primary);
}

.skip-btn {
    background: none;
    border: none;
    color: var(--foreground);
    opacity: 0.6;
    font-size: 0.875rem;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.skip-btn:hover {
    opacity: 1;
}

.onboarding-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.onboarding-step {
    display: none;
    text-align: center;
    padding: 0 1.5rem;
}

.onboarding-step.active {
    display: block;
    animation: fadeIn 0.6s ease-out;
}

.icon-circle {
    width: 96px;
    height: 96px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.8s ease-out;
}

.icon-large {
    width: 48px;
    height: 48px;
    color: var(--white);
}

.onboarding-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--foreground);
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

.onboarding-description {
    font-size: 1.125rem;
    color: var(--foreground);
    opacity: 0.7;
    max-width: 28rem;
    margin: 0 auto;
    line-height: 1.6;
}

.onboarding-btn {
    width: 100%;
}

/* Main Layout */
.main-content {
    padding: 2rem 1.5rem 6rem;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    color: var(--foreground);
}

.page-title-small {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--foreground);
}

.page-title-medium {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--foreground);
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
}

.icon-btn svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--foreground);
    cursor: pointer;
    font-size: 1rem;
}

.back-btn svg {
    width: 24px;
    height: 24px;
}

/* Status Card */
.status-card {
    background: linear-gradient(135deg, #FFFBF0 0%, #D5E8E8 100%);
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 12px var(--shadow);
    margin-bottom: 1.5rem;
}

.status-subtitle {
    font-size: 1.125rem;
    color: var(--foreground);
    opacity: 0.7;
    margin-bottom: 1rem;
}

.status-time {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: var(--primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.status-quality {
    font-size: 0.875rem;
    color: var(--foreground);
    opacity: 0.6;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow);
}

.stat-value {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--foreground);
    opacity: 0.6;
}

/* Chart Card */
.chart-card {
    background: var(--white);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.chart-card h3 {
    color: var(--foreground);
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 500;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 180px;
}

#activity-chart {
    width: 100%;
    height: 100%;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    color: var(--foreground);
    opacity: 0.5;
    margin-top: 0.5rem;
}

/* Live Page */
.live-status-card {
    background: linear-gradient(135deg, #FFFBF0 0%, #D5E8E8 100%);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 4px 12px var(--shadow);
    margin-bottom: 1rem;
}

.pulse-container {
    position: relative;
    height: 192px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
}

.pulse-ring {
    position: absolute;
    border-radius: 50%;
    background: var(--primary);
}

.pulse-ring-1 {
    width: 224px;
    height: 224px;
    animation: pulse 3s ease-in-out infinite;
}

.pulse-ring-2 {
    width: 160px;
    height: 160px;
    animation: pulseSecondary 3s ease-in-out infinite;
    animation-delay: 0.5s;
}

.pulse-center {
    position: relative;
    width: 96px;
    height: 96px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
    box-shadow: 0 4px 16px var(--shadow);
    animation: heartbeat 2s ease-in-out infinite;
}

.live-status-text {
    text-align: center;
}

.live-status-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.live-status-desc {
    font-size: 0.875rem;
    color: var(--foreground);
    opacity: 0.6;
}

/* Stats Grid 2 Columns */
.stats-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card-horizontal {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.stat-label-small {
    font-size: 0.75rem;
    color: var(--foreground);
    opacity: 0.6;
    margin-bottom: 0.125rem;
}

.stat-value-small {
    font-size: 1rem;
    color: var(--primary);
}

/* Activity Log */
.activity-log {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.activity-log h4 {
    color: var(--foreground);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.activity-item:not(:last-child) {
    border-bottom: 1px solid rgba(13, 148, 136, 0.1);
}

.activity-time {
    font-size: 0.875rem;
    color: var(--foreground);
    opacity: 0.7;
}

.activity-text {
    font-size: 0.875rem;
    color: var(--foreground);
}

/* Settings */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.setting-item {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.setting-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.setting-icon svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.setting-text {
    flex: 1;
}

.setting-text h4 {
    color: var(--foreground);
    margin-bottom: 0.125rem;
    font-size: 1rem;
    font-weight: 500;
}

.setting-text p {
    font-size: 0.75rem;
    color: var(--foreground);
    opacity: 0.6;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--muted);
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: var(--white);
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Settings Buttons */
.settings-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.setting-btn {
    width: 100%;
    background: var(--white);
    border: none;
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 8px var(--shadow);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.setting-btn:active {
    transform: scale(0.98);
}

.setting-btn svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.setting-btn span {
    color: var(--foreground);
    font-size: 1rem;
}

/* Notifications */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.notification-item {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    box-shadow: 0 2px 8px var(--shadow);
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.notification-item:hover {
    box-shadow: 0 4px 16px var(--shadow);
}

.notification-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
    gap: 0.5rem;
}

.notification-header h4 {
    color: var(--foreground);
    font-size: 1rem;
    font-weight: 500;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--foreground);
    opacity: 0.5;
    flex-shrink: 0;
}

.notification-content p {
    font-size: 0.875rem;
    color: var(--foreground);
    opacity: 0.7;
    line-height: 1.4;
}

/* Version Text */
.version-text {
    text-align: center;
    margin-top: 3rem;
}

.version-text p {
    font-size: 0.875rem;
    color: var(--foreground);
    opacity: 0.4;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid rgba(13, 148, 136, 0.15);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 12px var(--shadow);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--foreground);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.nav-item.active {
    color: var(--primary);
    opacity: 1;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 1.5rem 1rem 6rem;
    }

    .status-time {
        font-size: 2.5rem;
    }

    .onboarding-title {
        font-size: 1.75rem;
    }

    .onboarding-description {
        font-size: 1rem;
    }
}
