/* loyalty/static/loyalty/css/main.css */

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #333;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   NAVIGATION
   ============================================ */
nav {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition-normal);
}

nav:hover {
    background: rgba(255, 255, 255, 0.15);
}

nav .logo {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav .logo:hover {
    transform: scale(1.05);
}

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

nav a {
    color: white;
    text-decoration: none;
    transition: var(--transition-fast);
    font-weight: 500;
}

nav a:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* ============================================
   CONTAINER & CARDS
   ============================================ */
.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    width: 100%;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
    animation: slideUp 0.4s ease-out;
}

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

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark);
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

/* ============================================
   MESSAGES & ALERTS
   ============================================ */
.messages {
    list-style: none;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease-out;
}

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

.messages li {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.messages .success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

.messages .error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.messages .warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning);
}

.messages .info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition-normal);
    background: white;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

input::placeholder {
    color: var(--gray-400);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-secondary {
    background: var(--gray-500);
}

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

.btn-danger {
    background: var(--danger);
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading {
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }

.link {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* ============================================
   CHOICE CARDS
   ============================================ */
.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.choice-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    transition: var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.choice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition-normal);
}

.choice-card:hover::before {
    left: 100%;
}

.choice-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.choice-card h3 {
    color: white;
    margin-bottom: 0.5rem;
}

.choice-card p {
    opacity: 0.9;
    font-size: 0.9rem;
    margin: 0;
}

/* ============================================
   ERROR LIST
   ============================================ */
.errorlist {
    list-style: none;
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    nav {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    nav .logo {
        font-size: 1.25rem;
    }
    
    nav .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .choice-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
    nav {
        padding: 0.75rem;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"] {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem;
    }
}

/* ============================================
   DARK MODE SUPPORT (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */
html {
    scroll-behavior: smooth;
}

/* ============================================
   FOCUS VISIBLE (Accessibility)
   ============================================ */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    nav, .btn, .choice-card {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
