/* ========================================
   EngineeringSheets.com - Core Styles
   Dark theme with electric blue accents
   ======================================== */

/* CSS Variables */
:root {
    /* Colors */
    --primary: #00D4FF;
    --primary-dark: #00A8CC;
    --primary-light: #33DDFF;
    --primary-glow: rgba(0, 212, 255, 0.3);

    --bg-dark: #0a0e14;
    --bg-card: #12181f;
    --bg-card-hover: #1a222d;
    --bg-input: #1a222d;

    --text-white: #ffffff;
    --text-light: #e0e0e0;
    --text-muted: #8899a6;
    --text-dim: #5c6b7a;

    --border-color: #2a3441;
    --border-light: #3a4451;

    --success: #00c853;
    --warning: #ffc107;
    --error: #ff5252;
    --sale: #ff4757;

    /* Typography */
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --container-max: 1400px;
    --nav-height: 70px;
    --section-padding: 80px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--primary-glow);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Grid Paper Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-white);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--bg-dark);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px var(--primary-glow);
    color: var(--bg-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--bg-dark);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--border-light);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.125rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: all var(--transition-normal);
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Form Elements */
input, select, textarea {
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    transition: border-color var(--transition-fast);
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

input::placeholder {
    color: var(--text-dim);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.badge-sale {
    background: var(--sale);
    color: white;
}

.badge-new {
    background: var(--success);
    color: white;
}

/* Price Styling */
.price {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.price-original {
    font-size: 1rem;
    color: var(--text-dim);
    text-decoration: line-through;
    margin-right: 8px;
}

/* Section Styling */
.section {
    padding: var(--section-padding) 0;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    margin-bottom: 16px;
}

.section-header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Top Banner */
.top-banner {
    background: linear-gradient(90deg, var(--sale), #ff6b81);
    color: white;
    text-align: center;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.top-banner code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    margin-left: 8px;
}

/* Trust Badges */
.trust-badges {
    display: flex;
    gap: 32px;
    justify-content: center;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.trust-badge svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

/* Responsive Grid */
@media (max-width: 1200px) {
    .grid-6 { grid-template-columns: repeat(4, 1fr); }
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
    .grid-6 { grid-template-columns: repeat(3, 1fr); }
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-6, .grid-5, .grid-4, .grid-3, .grid-2 {
        grid-template-columns: 1fr;
    }

    :root {
        --section-padding: 48px;
    }
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs span {
    color: var(--text-dim);
}

/* Rating Stars */
.rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating .star {
    color: #ffc107;
    font-size: 1rem;
}

.rating .star.empty {
    color: var(--border-color);
}

.rating-text {
    margin-left: 8px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Countdown Timer */
.countdown {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.countdown-item {
    text-align: center;
}

.countdown-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-width: 70px;
}

.countdown-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-white { color: var(--text-white); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.py-1 { padding-top: 8px; padding-bottom: 8px; }
.py-2 { padding-top: 16px; padding-bottom: 16px; }
.py-3 { padding-top: 24px; padding-bottom: 24px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden { display: none !important; }
.visible { display: block; }

/* Formula Font Styling */
.formula {
    font-family: var(--font-mono);
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s ease forwards;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Selection */
::selection {
    background: var(--primary);
    color: var(--bg-dark);
}

/* ========================================
   Category Icons System
   ======================================== */
.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--primary);
}

.category-icon svg {
    width: 50%;
    height: 50%;
}

/* Sizes */
.category-icon.icon-sm {
    width: 48px;
    height: 48px;
}

.category-icon.icon-md {
    width: 60px;
    height: 60px;
}

.category-icon.icon-lg {
    width: 80px;
    height: 80px;
}

.category-icon.icon-xl {
    width: 120px;
    height: 120px;
}

/* Full size for product cards */
.category-icon.icon-full {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 8px 8px 0 0;
    border: none;
    border-bottom: 1px solid var(--border-color);
}

.category-icon.icon-full svg {
    width: 64px;
    height: 64px;
}
