/* Workout Tracker - Mobile-First Styles */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --light: #f9fafb;
    --gray: #6b7280;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
    padding-bottom: 80px;
}

/* App Container - Mobile First */
.app-container {
    max-width: 480px;
    padding: 1rem;
    margin: 0 auto;
}

/* Main Content */
.main-content {
    padding-top: 0.5rem;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: white;
}

.stat-card {
    border-radius: var(--radius);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray);
    font-size: 0.7rem;
    padding: 0.5rem;
    transition: color 0.2s;
}

.bottom-nav .nav-item i {
    font-size: 1.3rem;
    margin-bottom: 0.2rem;
}

.bottom-nav .nav-item.active,
.bottom-nav .nav-item:hover {
    color: var(--primary);
}

/* Auth Pages */
.auth-page {
    padding-top: 2rem;
}

.auth-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.auth-icon i {
    font-size: 2.5rem;
    color: white;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--warning);
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8rem;
    z-index: 9999;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Sync Badge */
.sync-badge {
    position: fixed;
    top: 10px;
    right: 10px;
    background: var(--warning);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    z-index: 9998;
    box-shadow: var(--shadow);
}

/* Install Button */
.install-btn {
    position: fixed;
    bottom: 90px;
    right: 16px;
    border-radius: 30px;
    padding: 0.75rem 1.25rem;
    box-shadow: var(--shadow);
    z-index: 999;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Form Styles */
.form-control-lg,
.form-select-lg {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-group-text {
    background: var(--light);
    border-radius: 10px 0 0 10px;
    border-right: none;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 10px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-1px);
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-weight: 600;
}

/* Activity List */
.activity-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.3rem;
}

.activity-icon.cardio {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.activity-icon.strength {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.activity-icon.flexibility {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.activity-icon.other {
    background: rgba(107, 114, 128, 0.1);
    color: var(--gray);
}

.activity-details {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.activity-meta {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Weekly Chart */
.weekly-chart {
    margin-top: 1rem;
}

.day-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.day-bar .bar {
    width: 30px;
    background: linear-gradient(to top, var(--primary), var(--success));
    border-radius: 5px 5px 0 0;
    min-height: 4px;
    transition: height 0.5s ease;
}

.day-bar span {
    font-size: 0.7rem;
    color: var(--gray);
    margin-top: 0.3rem;
}

/* Goal Card */
.goal-card {
    border-left: 4px solid var(--primary);
    margin-bottom: 0.75rem;
}

.goal-card.inactive {
    border-left-color: var(--gray);
    opacity: 0.7;
}

.goal-progress {
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    overflow: hidden;
    margin-top: 0.5rem;
}

.goal-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 0.5s ease;
}

/* Routine Card */
.routine-card {
    margin-bottom: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.routine-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.routine-item-row {
    background: var(--light);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Offline Page */
.offline-page {
    padding-top: 3rem;
}

.offline-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Exercise Types Icons Mapping */
.exercise-running::before {
    content: "🏃";
}

.exercise-cycling::before {
    content: "🚴";
}

.exercise-swimming::before {
    content: "🏊";
}

.exercise-walking::before {
    content: "🚶";
}

.exercise-hiit::before {
    content: "⚡";
}

.exercise-weight_training::before {
    content: "🏋️";
}

.exercise-yoga::before {
    content: "🧘";
}

.exercise-stretching::before {
    content: "🤸";
}

/* Responsive adjustments */
@media (max-width: 360px) {
    .app-container {
        padding: 0.75rem;
    }

    .bottom-nav .nav-item {
        font-size: 0.65rem;
    }

    .bottom-nav .nav-item i {
        font-size: 1.1rem;
    }
}

/* PWA Standalone Mode */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --light: #1f2937;
        --dark: #f9fafb;
    }

    body {
        background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
        color: #f9fafb;
    }

    .card {
        background: #374151;
        color: #f9fafb;
    }

    .bottom-nav {
        background: #1f2937;
        border-top: 1px solid #374151;
    }

    .form-control,
    .form-select {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }

    .input-group-text {
        background: #4b5563;
        color: #f9fafb;
    }

    .list-group-item {
        background: #374151;
        color: #f9fafb;
        border-color: #4b5563;
    }

    .text-muted {
        color: #9ca3af !important;
    }

    /* Modals for dark mode */
    .modal-content {
        background-color: #374151;
        color: #f9fafb;
        border: 1px solid #4b5563;
    }

    .modal-header,
    .modal-footer {
        border-color: #4b5563;
    }

    .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%);
    }
}