/* Pomodoro Productivity App - Global Styles
   Based on UI Design Document specifications
   c:\Users\Public\WEBDEV\Pomodoro\src\Client\wwwroot\css\app.css */

/* =======================
   CSS Custom Properties (CSS Variables)
   ======================= */
:root {
    /* Color Palette - Warm and energizing gradients */
    --pomodoro-primary: #ff6b6b;      /* Warm red */
    --pomodoro-primary-dark: #e55555;
    --pomodoro-secondary: #4ecdc4;     /* Accent teal */
    --pomodoro-secondary-dark: #45b7aa;
    --pomodoro-warning: #ffa726;       /* Warm orange */
    --pomodoro-success: #66bb6a;       /* Success green */
    --pomodoro-break: #81c784;         /* Break green */
    
    /* Neutral colors */
    --pomodoro-light: #f8f9fa;
    --pomodoro-medium: #e9ecef;
    --pomodoro-dark: #343a40;
    --pomodoro-text: #212529;
    --pomodoro-text-muted: #6c757d;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--pomodoro-warning) 0%, var(--pomodoro-primary) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--pomodoro-secondary) 0%, var(--pomodoro-secondary-dark) 100%);
    
    /* Typography - Inter font family */
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Spacing (8px grid system) */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-xxl: 3rem;     /* 48px */
    
    /* Border radius */
    --border-radius-sm: 0.375rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Animation - cubic-bezier for timer easing */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --timer-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =======================
   Base Styles
   ======================= */
* {
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-normal);
    line-height: 1.6;
    color: var(--pomodoro-text);
    background-color: var(--pomodoro-light);
    margin: 0;
    padding: 0;
    height: 100%;
}

/* =======================
   Bootstrap 5 Overrides
   ======================= */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--border-radius);
    font-weight: var(--font-weight-medium);
    padding: var(--spacing-sm) var(--spacing-lg);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--gradient-primary);
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gradient-secondary);
    border: none;
    color: white;
}

.btn-secondary:hover {
    background: var(--gradient-secondary);
    filter: brightness(1.1);
    color: white;
}

.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: all var(--transition-normal);
}

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

/* =======================
   Typography Utilities
   ======================= */
.text-timer {
    font-size: 3rem;
    font-weight: var(--font-weight-bold);
    color: var(--pomodoro-primary);
    line-height: 1.2;
}

.text-subtitle {
    font-size: 1.25rem;
    font-weight: var(--font-weight-medium);
    color: var(--pomodoro-text-muted);
}

@media (max-width: 768px) {
    .text-timer {
        font-size: 2.5rem;
    }
}

/* =======================
   Layout Components
   ======================= */
.main-content {
    min-height: calc(100vh - 120px);
    padding: var(--spacing-lg);
}

.sidebar {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: var(--spacing-lg);
}

/* =======================
   Loading Screen
   ======================= */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--gradient-primary);
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 0 auto var(--spacing-md) auto;
}

.loading-progress circle {
    fill: none;
    stroke: white;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transition: stroke-dasharray 0.3s;
}

.loading-progress circle:first-child {
    opacity: 0.3;
}

.loading-progress circle:last-child {
    stroke-dasharray: calc(3.141592653589793 * 40%);
    stroke-dashoffset: calc(3.141592653589793 * 40%);
    animation: loading-progress 1.5s linear infinite;
}

@keyframes loading-progress {
    0% {
        stroke-dasharray: 0 calc(3.141592653589793 * 80%);
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: calc(3.141592653589793 * 40%) calc(3.141592653589793 * 40%);
        stroke-dashoffset: calc(3.141592653589793 * -10%);
    }
    100% {
        stroke-dasharray: calc(3.141592653589793 * 40%) calc(3.141592653589793 * 40%);
        stroke-dashoffset: calc(3.141592653589793 * -50%);
    }
}

.loading-progress-text {
    color: white;
    font-weight: var(--font-weight-medium);
    font-size: 1.125rem;
    text-align: center;
}

/* =======================
   Form Validation
   ======================= */
.valid.modified:not([type=checkbox]) {
    outline: 2px solid var(--pomodoro-success);
    outline-offset: 2px;
}

.invalid {
    outline: 2px solid var(--pomodoro-primary);
    outline-offset: 2px;
}

.validation-message {
    color: var(--pomodoro-primary);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
}

/* =======================
   Error UI
   ======================= */
#blazor-error-ui {
    background: var(--pomodoro-primary);
    bottom: 0;
    box-shadow: var(--shadow-lg);
    color: white;
    display: none;
    left: 0;
    padding: var(--spacing-md) var(--spacing-lg);
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-medium);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: var(--spacing-lg);
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    transition: opacity var(--transition-fast);
}

#blazor-error-ui .dismiss:hover {
    opacity: 0.8;
}

.blazor-error-boundary {
    background: linear-gradient(45deg, var(--pomodoro-primary), var(--pomodoro-primary-dark));
    padding: var(--spacing-lg);
    color: white;
    border-radius: var(--border-radius);
    margin: var(--spacing-md);
    font-family: var(--font-family-primary);
}

.blazor-error-boundary::after {
    content: "An error has occurred. Please try refreshing the page.";
    font-weight: var(--font-weight-medium);
}

/* =======================
   Accessibility & Motion
   ======================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators */
*:focus-visible {
    outline: 2px solid var(--pomodoro-secondary);
    outline-offset: 2px;
    border-radius: var(--border-radius-sm);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --pomodoro-primary: #d00000;
        --pomodoro-secondary: #006d75;
        --pomodoro-text: #000000;
        --pomodoro-light: #ffffff;
    }
}

/* =======================
   Responsive Utilities
   ======================= */
@media (max-width: 576px) {
    .main-content {
        padding: var(--spacing-md);
    }
    
    :root {
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        margin-bottom: var(--spacing-lg);
    }
}

/* =======================
   Responsive Display Utilities
   ======================= */

/* Default state - hide both */
.mobile-only,
.desktop-only {
    display: none !important;
}

/* Mobile breakpoint - show mobile, hide desktop */
@media (max-width: 640.98px) {
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
}

/* Desktop breakpoint - show desktop, hide mobile */
@media (min-width: 641px) {
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: block !important;
    }
}

/* Mobile bottom padding for bottom navigation */
@media (max-width: 640.98px) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}