/* CSS Variables */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    
    --border-color: #374151;
    --border-light: #4b5563;
    
    --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);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
.header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-color);
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.nav-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

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

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-top: 0.5rem;
}

/* Form Elements */
.date-input,
.week-selector {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.date-input:focus,
.week-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.date-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-info {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    line-height: 1.4;
}

.date-info small {
    color: var(--text-secondary);
}

/* Workout List */
.workout-list {
    margin-top: 1rem;
}

.workout-section {
    margin-bottom: 1.5rem;
}

.workout-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    font-weight: 600;
}

.workout-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.workout-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.workout-card:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.workout-card.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.workout-card.today {
    border-color: var(--success-color);
    background-color: var(--success-light);
}

.workout-card.completed {
    border-color: var(--success-color);
    background-color: var(--success-light);
}

.workout-card.partial {
    border-color: var(--warning-color);
    background-color: var(--warning-light);
}

.workout-date {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.workout-stats {
    display: flex;
    gap: 0.75rem;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.workout-stats span {
    background-color: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.today-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--success-color);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.completion-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--text-secondary);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.completion-badge.completed {
    background-color: var(--success-color);
}

    .no-workouts {
        text-align: center;
        padding: 2rem;
        color: var(--text-secondary);
    }
    
    /* Mobile responsiveness for workout cards */
    @media (max-width: 768px) {
        .workout-cards {
            grid-template-columns: 1fr;
            gap: 0.5rem;
        }
        
        .workout-card {
            padding: 0.75rem;
        }
        
        .workout-date {
            font-size: var(--font-size-base);
        }
        
        .workout-stats {
            flex-direction: column;
            gap: 0.25rem;
        }
        
        .workout-stats span {
            font-size: var(--font-size-xs);
        }
    }

/* Buttons */
.btn-primary,
.btn-secondary {
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-light);
}

/* Workout Content */
.workout-content {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
}

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

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: var(--font-size-lg);
}

.exercise-group {
    margin-bottom: 2rem;
    background-color: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.exercise-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--primary-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.exercise-header:hover {
    background-color: var(--bg-tertiary);
}

.exercise-header:hover::before {
    opacity: 0.3;
}

.exercise-header:active {
    background-color: var(--bg-tertiary);
    transform: scale(0.98);
}

.exercise-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.exercise-name {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.exercise-order {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.collapse-icon {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    font-weight: bold;
    user-select: none;
}

.exercise-group.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.sets-container {
    display: grid;
    gap: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    opacity: 1;
    max-height: none;
    overflow: hidden;
}

.exercise-group.collapsed .sets-container {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
}

.set-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    min-height: 60px;
}

.set-number {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    min-width: 60px;
}

.set-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.set-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.set-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.weight-input {
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-weight: 600;
    width: 100px;
    min-height: 44px;
    text-align: center;
    transition: all 0.2s ease;
}

.weight-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    transform: scale(1.02);
}

.weight-unit {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-weight: 500;
}

.completed-checkbox {
    width: 2.5rem;
    height: 2.5rem;
    transform: scale(1.3);
    accent-color: var(--success-color);
    cursor: pointer;
    transition: transform 0.2s ease;
    /* Safari-specific improvements */
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    appearance: none;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    position: relative;
}

.completed-checkbox:checked {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.completed-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.125rem;
    font-weight: bold;
    line-height: 1;
}

.completed-checkbox:hover {
    transform: scale(1.4);
}

.completed-checkbox:active {
    transform: scale(1.1);
}

/* Safari-specific focus styles */
.completed-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease;
}

.checkbox-container:hover {
    background-color: rgba(16, 185, 129, 0.1);
}

/* Set Rating Styles */
.set-rating-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.set-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #495057;
}

.set-number {
    font-weight: 600;
    color: #212529;
}

.set-details {
    color: #6c757d;
}

.weight-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.weight-input {
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    width: 80px;
    min-height: 36px;
    text-align: center;
    transition: all 0.2s ease;
}

.weight-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: scale(1.02);
}

.weight-unit {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 20px;
}

.rating-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.rating-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
    font-size: 12px;
    color: #495057;
}

.rating-btn:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
    transform: translateY(-1px);
}

.rating-btn.active {
    border-color: #007bff;
    background: #007bff;
    color: white;
}

.rating-btn.rating-easy.active {
    border-color: #28a745;
    background: #28a745;
}

.rating-btn.rating-hard.active {
    border-color: #ffc107;
    background: #ffc107;
    color: #212529;
}

.rating-btn.rating-fail.active {
    border-color: #dc3545;
    background: #dc3545;
}

.rating-icon {
    font-size: 16px;
    font-weight: bold;
}

.rating-label {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile styles for set ratings */
@media (max-width: 768px) {
    .set-rating-container {
        padding: 8px;
        gap: 6px;
    }
    
    .set-info {
        font-size: 13px;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .rating-buttons {
        gap: 6px;
    }
    
    .rating-btn {
        padding: 6px 8px;
        min-width: 50px;
        font-size: 11px;
    }
    
    .rating-icon {
        font-size: 14px;
    }
    
    .rating-label {
        font-size: 10px;
    }
}

/* Desktop specific adjustments */
@media (min-width: 769px) {
    .set-row {
        display: grid;
        grid-template-columns: auto 1fr auto auto auto;
        gap: 1rem;
        align-items: center;
    }
    
    .set-row-header {
        display: contents;
    }
    
    .set-details {
        margin-bottom: 0;
        background-color: transparent;
        padding: 0;
        justify-content: flex-start;
    }
    
    .set-controls {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-end;
    }
}

/* Touch improvements for all devices */
@media (hover: none) and (pointer: coarse) {
    .completed-checkbox {
        width: 2.75rem;
        height: 2.75rem;
        transform: scale(1.4);
        /* Ensure proper touch handling on mobile Safari */
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .completed-checkbox:checked::after {
        font-size: 1.25rem;
    }
    
    .weight-input {
        min-height: 52px;
        font-size: var(--font-size-lg);
    }
    
    .exercise-header {
        padding: 1.75rem 1.5rem;
    }
    
    .nav-btn {
        min-height: 52px;
        padding: 1rem 1.5rem;
    }
    
    /* Rating button touch improvements */
    .rating-btn {
        width: 3rem;
        height: 3rem;
        font-size: 1rem;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .rating-icon {
        font-size: 1.25rem;
    }
    
    .rating-label {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }
    
    .rep-ratings-grid {
        gap: 0.75rem;
    }
    
    .rep-rating-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .rep-number {
        font-size: var(--font-size-base);
        font-weight: 600;
        color: var(--text-primary);
        min-width: unset;
    }
    
    .rep-weight-input-container {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .rep-weight-input {
        width: 100px;
        min-height: 44px;
        font-size: var(--font-size-base);
    }
    
    .rating-buttons {
        display: flex;
        gap: 0.75rem;
        width: 100%;
        justify-content: space-between;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .nav {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .nav-btn {
        padding: 0.75rem 1.25rem;
        font-size: var(--font-size-base);
        min-height: 44px;
    }
    
    .workout-content {
        padding: 1rem;
    }
    
    .exercise-name {
        font-size: var(--font-size-2xl);
        line-height: 1.3;
    }
    
    .set-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.25rem;
        min-height: auto;
    }
    
    .set-row-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
    }
    
    .set-details {
        font-size: var(--font-size-lg);
        font-weight: 600;
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    .set-controls {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .set-controls > div:first-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
    
    .rating-buttons {
        display: flex;
        gap: 0.75rem;
        width: 100%;
        justify-content: space-between;
    }
    
    .rating-btn {
        flex: 1;
        max-width: 4rem;
        height: 3.5rem;
    }
    
    .weight-input {
        flex: 1;
        max-width: 120px;
        padding: 1rem;
        font-size: var(--font-size-lg);
        min-height: 48px;
    }
    
    .completed-checkbox {
        width: 2.5rem;
        height: 2.5rem;
        transform: scale(1.3);
    }
    
    .completed-checkbox:checked::after {
        font-size: 1.125rem;
    }
    
    .completed-checkbox:hover {
        transform: scale(1.4);
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .metric-card {
        padding: 1.25rem;
    }
    
    .import-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 1rem 1.5rem;
        font-size: var(--font-size-base);
        min-height: 48px;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
    }
    
    .toast {
        min-width: auto;
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .exercise-name {
        font-size: var(--font-size-xl);
    }
    
    .set-details {
        font-size: var(--font-size-base);
    }
    
    .weight-input {
        font-size: var(--font-size-base);
        padding: 0.875rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .header {
        padding: 0.25rem 0;
    }
    .header .container {
        flex-direction: row;
        gap: 0.25rem;
        padding: 0 0.25rem;
    }
    .logo {
        font-size: 1.1rem;
        padding: 0;
        margin: 0;
    }
    .nav {
        gap: 0.25rem;
    }
    .nav-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.85rem;
        min-width: unset;
    }
    .logout-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.85rem;
        margin-left: 0.25rem;
    }
    
    .workout-content {
        padding: 0.75rem;
    }
    
    .exercise-header {
        padding: 1rem;
    }
    
    .sets-container {
        padding: 1rem;
    }
    
    .original-weight-indicator {
        font-size: 1rem;
    }
    
    /* Rep ratings for very small screens */
    .rating-btn {
        max-width: 3.5rem;
        height: 3rem;
    }
    
    .rating-icon {
        font-size: 1rem;
    }
    
    .rating-label {
        font-size: 0.625rem;
    }
}

/* Authentication Page */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    padding: 1rem;
}

.auth-container {
    background-color: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-header .logo {
    font-size: var(--font-size-3xl);
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    margin: 0;
}

.auth-form {
    margin-bottom: 2rem;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-full {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.auth-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    display: none;
}

.auth-status.success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
    display: block;
}

.auth-status.error {
    color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

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

.auth-footer p {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* Paste URL Section */
.paste-url-section {
    margin-top: 2rem;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-color);
}

.divider span {
    background-color: var(--bg-primary);
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    position: relative;
    z-index: 1;
}

/* Main App */
.main-app {
    min-height: 100vh;
    background-color: var(--bg-primary);
    display: none;
}

.logout-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.original-weight-indicator {
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.original-weight-indicator:hover {
    opacity: 1;
}

/* PWA Update Notification */
.update-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease-out;
}

.update-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.update-icon {
    font-size: 1.25rem;
    animation: spin 2s linear infinite;
}

.update-text {
    flex: 1;
    font-weight: 500;
}

.update-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.update-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.update-dismiss {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.update-dismiss:hover {
    background: rgba(255, 255, 255, 0.1);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .update-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .update-text {
        order: -1;
    }
}