/* =============================================
   EXIMIUS DESIGN SYSTEM - PLATE CALCULATOR
   Light & Dark Themes - Premium Aesthetic
   ============================================= */

:root {
    /* Dark Theme (Default) */
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-input: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --accent: #00ff88;
    --accent-dim: #00cc6a;
    --accent-glow: rgba(0, 255, 136, 0.2);
    --border: #333333;
    --success: #00ff88;
    --warning: #ff6b35;
    --error: #ff4444;
    
    /* Plate Colors - Premium Palette */
    --plate-45: #00ff88;
    --plate-35: #00cc6a;
    --plate-25: #22d3ee;
    --plate-10: #60a5fa;
    --plate-5: #a78bfa;
    --plate-2-5: #f472b6;
    
    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Work Sans', sans-serif;
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 20px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Light Theme */
[data-theme="light"] {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-input: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --accent: #00cc6a;
    --accent-dim: #00a555;
    --accent-glow: rgba(0, 204, 106, 0.15);
    --border: #e2e8f0;
    --success: #00cc6a;
    --warning: #f59e0b;
    --error: #ef4444;
}

/* =============================================
   GLOBAL STYLES
   ============================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* =============================================
   PAGE WRAPPER
   ============================================= */

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
}

/* =============================================
   HEADER
   ============================================= */

.header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md) 0;
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    margin-bottom: var(--spacing-sm);
}

.theme-toggle {
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-smooth);
    color: var(--text-secondary);
}

.theme-toggle:hover {
    background-color: var(--bg-card);
    border-color: var(--accent);
    color: var(--accent);
    transform: rotate(10deg);
}

.theme-toggle:active {
    transform: rotate(10deg) scale(0.95);
}

.sun-icon,
.moon-icon {
    position: absolute;
    transition: all var(--transition-smooth);
}

/* Default dark theme - show sun icon */
.sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.moon-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0.5);
}

/* Light theme - show moon icon */
[data-theme="light"] .sun-icon {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
}

[data-theme="light"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.logo-link {
    display: inline-block;
    transition: all var(--transition-smooth);
    text-decoration: none;
}

.logo-link:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 4px 12px var(--accent-glow));
}

.logo-image {
    max-width: 120px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    border: 2px solid var(--border);
    transition: border-color var(--transition-smooth);
}

.logo-link:hover .logo-image {
    border-color: var(--accent);
}

.tagline {
    margin-top: var(--spacing-sm);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.9;
}

/* =============================================
   CONTAINER
   ============================================= */

.container {
    max-width: 680px;
    margin: 0 auto;
    flex: 1;
}

/* =============================================
   DISCLAIMER
   ============================================= */

.disclaimer {
    background-color: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.3);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    line-height: 1.5;
}

.disclaimer-icon {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--warning);
}

/* =============================================
   CALCULATOR CARD
   ============================================= */

.calculator-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: var(--spacing-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: box-shadow var(--transition-smooth);
}

[data-theme="light"] .calculator-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.calculator-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* =============================================
   INPUT SECTION
   ============================================= */

.input-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 0.8rem;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    flex: 1;
    padding-right: 50px;
}

.input-unit {
    position: absolute;
    right: var(--spacing-md);
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none;
}

/* Text Inputs */
input[type="number"] {
    width: 100%;
    padding: 14px var(--spacing-md);
    padding-right: 40px;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 500;
    transition: all var(--transition-smooth);
}

/* Style the number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: 38px;
    margin-right: 8px;
}

/* Firefox number input */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button;
    cursor: pointer;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background-color: rgba(42, 42, 42, 0.8);
}

input[type="number"]::placeholder {
    color: var(--text-tertiary);
}

/* Select Wrapper */
.select-wrapper {
    position: relative;
}

.select-icon {
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
    transition: color var(--transition-smooth);
}

.select-wrapper:hover .select-icon {
    color: var(--accent);
}

/* Select Dropdown */
select {
    width: 100%;
    padding: 14px var(--spacing-md);
    padding-right: 50px;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-smooth);
    -webkit-appearance: none;
    appearance: none;
}

select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background-color: rgba(42, 42, 42, 0.8);
}

select:hover {
    border-color: var(--accent-dim);
}

/* =============================================
   CALCULATE BUTTON
   ============================================= */

.calculate-btn {
    margin-top: var(--spacing-sm);
    background: linear-gradient(135deg, var(--accent-dim) 0%, var(--accent) 100%);
    color: var(--bg-dark);
    padding: 16px var(--spacing-md);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.2);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 255, 136, 0.4);
}

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

.btn-icon {
    transition: transform var(--transition-smooth);
}

.calculate-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* =============================================
   ERROR MESSAGE
   ============================================= */

.error {
    color: var(--error);
    background-color: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    margin-top: var(--spacing-md);
    display: none;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

/* =============================================
   RESULTS SECTION
   ============================================= */

.results {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
    display: none;
    animation: fadeIn 0.4s ease;
}

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

.results-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    text-align: center;
}

/* =============================================
   PLATE LIST
   ============================================= */

.plate-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.plate-list p {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background-color: rgba(42, 42, 42, 0.5);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-smooth);
}

.plate-list p:hover {
    background-color: rgba(42, 42, 42, 0.8);
    transform: translateX(4px);
}

.plate-list span {
    min-width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* =============================================
   PLATE VISUALIZATION
   ============================================= */

.plate-visualization {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--spacing-lg);
    min-height: 140px;
    padding: var(--spacing-md) 0;
    overflow-x: auto;
    overflow-y: visible;
}

.barbell-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100%;
}

.barbell {
    width: calc(100% - 60px);
    max-width: 500px;
    height: 14px;
    background: linear-gradient(180deg, #64748b 0%, #475569 100%);
    position: relative;
    margin: 0 30px;
    border-radius: 7px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .barbell {
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.barbell::before,
.barbell::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    background: radial-gradient(circle, #64748b 0%, #475569 100%);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .barbell::before,
[data-theme="light"] .barbell::after {
    background: radial-gradient(circle, #94a3b8 0%, #64748b 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.barbell::before {
    left: -28px;
}

.barbell::after {
    right: -28px;
}

/* =============================================
   PLATES
   ============================================= */

.plate {
    position: absolute;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-dark);
    font-size: 13px;
    font-weight: 700;
    width: 28px;
    transform-origin: center center;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: plateLoad 0.4s ease;
}

@keyframes plateLoad {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.plate:hover {
    transform: scale(1.15) !important;
    z-index: 100;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* =============================================
   FOOTER
   ============================================= */

.footer {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-text {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.footer-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-smooth);
}

.footer-link:hover {
    color: var(--text-primary);
}

/* =============================================
   AD CONTAINER
   ============================================= */

.ad-container {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md);
    background-color: rgba(26, 26, 26, 0.5);
    border-radius: 12px;
    border: 1px solid var(--border);
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
}

.ad-container h4 {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

@media (max-width: 768px) {
    .calculator-title {
        font-size: 2rem;
    }
    
    .calculator-card {
        padding: var(--spacing-md);
    }
    
    .barbell {
        max-width: 350px;
    }
    
    .plate {
        width: 24px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .page-wrapper {
        padding: var(--spacing-sm);
    }
    
    .calculator-title {
        font-size: 1.75rem;
    }
    
    .header {
        margin-bottom: var(--spacing-md);
    }
    
    .tagline {
        font-size: 0.8rem;
    }
    
    .barbell {
        max-width: 280px;
    }
    
    .plate {
        width: 20px;
        font-size: 10px;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
}

/* =============================================
   ACCESSIBILITY
   ============================================= */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* =============================================
   WEBKIT SPECIFIC
   ============================================= */

/* Fix iOS zoom on input focus */
@media screen and (-webkit-min-device-pixel-ratio: 0) { 
    select,
    input[type="number"] {
        font-size: 16px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-input);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dim);
}
