/* ===== CSS Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ===== Navigation Bar ===== */
.navbar {
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.watch-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-link:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .nav-container {
        padding: 0.75rem 1rem;
    }
    
    .nav-brand {
        font-size: 1rem;
    }
    
    .watch-icon {
        font-size: 1.25rem;
    }
    
    .nav-links {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    #logoutBtn {
        padding: 0.4rem 0.6rem;
        font-size: 1.25rem;
        border: none;
        background: transparent;
    }
    
    #logoutBtn:hover {
        background: var(--bg-color);
    }
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* ===== Buttons ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: inherit;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

#logoutBtn {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    padding: 0.5rem;
}

#logoutBtn:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.2rem;
}

/* ===== Login Page ===== */
.login-page {
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.logo-container h1 {
    font-size: 2rem;
    color: var(--primary-color);
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input {
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    display: none;
    text-align: center;
}

.demo-credentials {
    text-align: center;
    color: var(--text-secondary);
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
}

/* ===== Hero Section ===== */
.hero-section {
    margin: 2rem 0;
}

.hero-content {
    display: grid;
    gap: 2rem;
    align-items: center;
}

.watch-display {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.watch-glow {
    position: absolute;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, rgba(99, 102, 241, 0) 70%);
    border-radius: 50%;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.watch-device {
    position: relative;
    width: 180px;
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.watch-screen {
    width: 180px;
    height: 180px;
    background: linear-gradient(145deg, #2a2d3a, #1a1d2a);
    border-radius: 35px;
    padding: 15px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(99, 102, 241, 0.2);
    border: 3px solid #333;
}

.watch-face {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #1a1d2a, #2a2d3a);
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white;
    padding: 1rem;
}

.watch-time-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.watch-time {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
}

.watch-date {
    font-size: 0.7rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.watch-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
}

.status-dot.connected {
    background: var(--success-color);
    animation: blink 2s ease-in-out infinite;
}

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

.watch-strap {
    width: 120px;
    height: 30px;
    background: linear-gradient(to right, #1a1d2a, #2a2d3a, #1a1d2a);
    border-radius: 10px;
}

.watch-strap-top {
    margin-bottom: -10px;
}

.watch-strap-bottom {
    margin-top: -10px;
}

.hero-info {
    text-align: center;
}

.hero-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.hero-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.connection-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.connection-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    display: block;
}

.connection-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.connection-message.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.connection-message.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* ===== Metrics Section ===== */
.metrics-section {
    margin: 2rem 0;
}

.metrics-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.metric-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.metric-header {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.metric-unit {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.metric-chart {
    height: 150px;
    margin-bottom: 1rem;
}

.metric-chart canvas {
    width: 100%;
    height: 100%;
}

.metric-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.metric-icon {
    font-size: 1.5rem;
}

/* ===== Recommendation Section ===== */
.recommendation-section {
    margin: 2rem 0;
}

.recommendation-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.recommendation-header {
    text-align: center;
    margin-bottom: 2rem;
}

.recommendation-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

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

.yoga-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.yoga-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.yoga-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.yoga-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.yoga-header h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.yoga-duration {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.yoga-description {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.yoga-benefits {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.yoga-benefits strong {
    color: var(--text-primary);
}

/* ===== Profile Page ===== */
.profile-section {
    margin: 2rem 0;
}

.profile-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    text-align: center;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-lg);
}

.avatar-icon {
    font-size: 3rem;
}

.profile-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

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

.profile-info,
.profile-stats,
.profile-device {
    margin-bottom: 2rem;
}

.profile-info h2,
.profile-stats h2,
.profile-device h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.info-item {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.info-item span {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-item {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2.5rem;
}

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

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-value {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.device-info {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.device-icon {
    font-size: 3rem;
}

.device-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.device-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.device-model,
.device-battery {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Responsive Design ===== */
@media (min-width: 640px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .hero-info {
        text-align: left;
    }

    .hero-info h1 {
        font-size: 2.5rem;
    }

    .watch-display {
        min-height: 400px;
    }

    .watch-glow {
        width: 350px;
        height: 350px;
    }

    .watch-device {
        width: 220px;
        height: 270px;
    }

    .watch-screen {
        width: 220px;
        height: 220px;
    }

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

    .watch-strap {
        width: 150px;
        height: 35px;
    }

    .container {
        padding: 2rem;
    }

    .login-card {
        padding: 3rem;
    }

    .profile-card {
        padding: 3rem;
    }
}

@media (min-width: 1024px) {
    .nav-container {
        padding: 1rem 2rem;
    }
}

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

.metric-card,
.yoga-item {
    animation: fadeIn 0.5s ease-out;
}

/* ===== Print Styles ===== */
@media print {
    .navbar,
    .btn,
    .connection-message {
        display: none;
    }
}
