/**
 * styles.css — EngineerHow Lifting Master
 * Global design system: tokens, typography, components, animations
 * Version 3.0 — Premium Redesign
 */

/* ==========================================
   GOOGLE FONTS
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ==========================================
   DESIGN TOKENS
   ========================================== */
:root {
    /* Primary palette */
    --primary: #003366;
    --primary-dark: #002244;
    --primary-light: #004d99;
    --accent: #ffcc00;
    --accent-hover: #e6b800;

    /* Neutral palette */
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Semantic palette */
    --success: #10b981;
    --success-bg: #d1fae5;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --info: #3b82f6;
    --info-bg: #dbeafe;

    /* Layout */
    --sidebar-width: 280px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 40px -4px rgba(0, 0, 0, 0.1), 0 8px 16px -8px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(0, 51, 102, 0.15);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    padding: 30px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   TYPOGRAPHY
   ========================================== */
h1 {
    color: var(--primary);
    font-size: 2.2rem;
    margin-bottom: 25px;
    border-left: 5px solid var(--accent);
    padding-left: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h2,
h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* ==========================================
   BRANDING
   ========================================== */
.brand-header img {
    width: 50px !important;
    height: auto !important;
    max-width: 100%;
}

/* ==========================================
   CARDS — Premium Elevated
   ========================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: var(--border-light);
    padding: 15px 25px;
    margin: -25px -25px 20px -25px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--primary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

/* ==========================================
   BUTTONS — Touch-friendly, animated
   ========================================== */
.btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-base);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 51, 102, 0.25);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-reset {
    background: linear-gradient(135deg, #64748b, #475569);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

/* ==========================================
   INPUTS — Modern form controls
   ========================================== */
input,
select {
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    width: 100%;
    margin-bottom: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-card);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

/* ==========================================
   TABLES — Clean data display
   ========================================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: 10px;
    box-shadow: var(--shadow-sm);
}

th {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    border-bottom: 1px solid var(--border-light);
    padding: 12px 16px;
    font-size: 0.95rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--border-light);
}

/* ==========================================
   ACCORDION — For Plan & RAMS
   ========================================== */
.accordion {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border-left: 4px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-base);
}

.accordion.active {
    border-left-color: var(--success);
}

.acc-header {
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    transition: background var(--transition-fast);
    font-size: 0.95rem;
}

.acc-header:hover {
    background: var(--border-light);
}

.acc-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow), padding var(--transition-slow);
    padding: 0 20px;
    background: var(--border-light);
}

.accordion.open .acc-body {
    max-height: 600px;
    padding: 20px;
    border-top: 1px solid var(--border);
}

/* ==========================================
   TEACHING STEPS — For Exercises
   ========================================== */
.step-box {
    background: var(--bg-card);
    border-left: 4px solid var(--accent);
    padding: 20px;
    margin-bottom: 12px;
    display: none;
    animation: fadeSlideIn 0.4s ease-out;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    box-shadow: var(--shadow-sm);
}

.step-box.visible {
    display: block;
}

.final-ans {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    padding: 18px;
    text-align: center;
    font-weight: 700;
    border-radius: var(--radius-sm);
    display: none;
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.final-ans.visible {
    display: block;
}

/* ==========================================
   MICRO-ANIMATIONS
   ========================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 51, 102, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(0, 51, 102, 0); }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}