/* ============================================================
   R Watch – Global Design System
   Clean, accessible, mobile-first
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Brand Colors */
    --primary: #E31B23;
    --primary-hover: #C1161D;
    --primary-light: rgba(227, 27, 35, 0.08);
    --primary-shadow: rgba(227, 27, 35, 0.25);

    /* Neutral Palette */
    --bg-body: #F8F9FB;
    --bg-card: #FFFFFF;
    --text-main: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border-light: #E5E7EB;
    --border-focus: var(--primary);

    /* Spacing (8px system) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    /* 12px */
    --font-size-sm: 0.875rem;
    /* 14px */
    --font-size-base: 1rem;
    /* 16px */
    --font-size-lg: 1.125rem;
    /* 18px */
    --font-size-xl: 1.25rem;
    /* 20px */
    --font-size-2xl: 1.5rem;
    /* 24px */
    --font-size-3xl: 1.875rem;
    /* 30px */
    --font-size-4xl: 2.25rem;
    /* 36px */

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.10);
    --shadow-focus: 0 0 0 3px var(--primary-light);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    font-size: var(--font-size-base);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-4);
    }
}

/* ============================================================
   CARDS
   ============================================================ */

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.glass-card:hover {
    box-shadow: var(--shadow-hover);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    min-height: 44px;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
    box-shadow: 0 2px 8px var(--primary-shadow);
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--primary-shadow);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px var(--primary-shadow);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus), 0 2px 8px var(--primary-shadow);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: #ffffff;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 0.625rem 1.25rem;
    min-height: 40px;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn-secondary:hover {
    background: var(--primary-light);
    border-color: var(--primary-hover);
    color: var(--primary-hover);
}

.btn-secondary:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

/* ============================================================
   INPUTS
   ============================================================ */

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    min-height: 44px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: var(--font-size-base);
    color: var(--text-main);
    background: #ffffff;
    outline: none;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}

.input-field:hover:not(:focus) {
    border-color: #D1D5DB;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -600px 0;
    }

    100% {
        background-position: 600px 0;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(227, 27, 35, 0.4);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(227, 27, 35, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(227, 27, 35, 0);
    }
}

.reveal {
    animation: reveal 0.5s ease-out forwards;
    opacity: 0;
}

/* Modal Overlay & Design */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.hidden {
    display: none;
}

/* Search suggestions alignment */
.suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #F3F4F6;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: #F9FAFB;
}

/* Skeleton loader */
.skeleton {
    background: #f0f2f5;
    background-image: linear-gradient(90deg, #f0f2f5 0%, #e8eaed 40%, #f0f2f5 80%);
    background-size: 600px 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: var(--radius-md);
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
    }
}

/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* ============================================================
   FOCUS VISIBLE (keyboard accessibility)
   ============================================================ */

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================================
   SELECTION
   ============================================================ */

::selection {
    background: var(--primary-light);
    color: var(--primary-hover);
}