/**
 * SourceParts.eu FTTR - Custom Styles
 * Extends Tailwind CSS with custom components
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --sp-primary: #0066cc;
    --sp-accent: #00f7ff;
    --sp-dark: #0a0f1c;
    --sp-darker: #060a12;
    --sp-border: rgba(255, 255, 255, 0.08);
    --sp-card: rgba(255, 255, 255, 0.03);
    --huawei-red: #e4002b;
}

/* ============================================
   Base Styles
   ============================================ */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(180deg, var(--sp-dark) 0%, #0d1424 50%, var(--sp-dark) 100%);
    background-attachment: fixed;
}

/* ============================================
   Glass Card Effect
   ============================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-card-solid {
    background: rgba(10, 15, 28, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================
   Glow Effects
   ============================================ */
.glow-accent {
    box-shadow: 0 0 60px rgba(0, 247, 255, 0.1);
}

.glow-primary {
    box-shadow: 0 0 60px rgba(0, 102, 204, 0.15);
}

/* ============================================
   Gradient Text
   ============================================ */
.stat-number,
.gradient-text {
    background: linear-gradient(135deg, var(--sp-accent) 0%, var(--sp-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Buttons
   ============================================ */
.cta-button {
    background: linear-gradient(135deg, var(--sp-accent) 0%, #0099ff 100%);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 247, 255, 0.3);
}

.cta-button:active {
    transform: scale(0.98);
}

.btn-outline {
    border: 1px solid var(--sp-border);
    transition: all 0.3s ease;
}

.btn-outline:hover {
    border-color: var(--sp-accent);
    background: rgba(0, 247, 255, 0.05);
}

/* ============================================
   Product Cards
   ============================================ */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 247, 255, 0.15);
}

.product-card .product-image {
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

/* ============================================
   Fiber Line Animation
   ============================================ */
.fiber-line {
    background: linear-gradient(90deg, transparent 0%, var(--sp-accent) 50%, transparent 100%);
    height: 1px;
    animation: pulse-line 3s ease-in-out infinite;
}

@keyframes pulse-line {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ============================================
   Badge Styles
   ============================================ */
.badge {
    background: rgba(0, 247, 255, 0.1);
    border: 1px solid rgba(0, 247, 255, 0.2);
}

.badge-popular {
    background: var(--sp-accent);
    color: var(--sp-dark);
}

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

/* ============================================
   Flag Buttons (Language Selector)
   ============================================ */
.flag-btn {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.flag-btn:hover,
.flag-btn.active {
    opacity: 1;
    transform: scale(1.1);
}

/* ============================================
   Form Inputs
   ============================================ */
.form-input {
    background: var(--sp-darker);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--sp-accent);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   Cart Panel
   ============================================ */
#cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: var(--sp-darker);
    border-left: 1px solid var(--sp-border);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 100;
    overflow-y: auto;
}

#cart-panel.open {
    transform: translateX(0);
}

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
}

#cart-panel.open ~ .cart-overlay {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Notifications
   ============================================ */
#cart-notification {
    font-weight: 600;
}

/* ============================================
   Price Toggle
   ============================================ */
.price-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 4px;
}

.price-toggle button {
    flex: 1;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.price-toggle button.active {
    background: var(--sp-accent);
    color: var(--sp-dark);
}

/* ============================================
   Specification Table
   ============================================ */
.spec-table {
    width: 100%;
}

.spec-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.spec-table td {
    padding: 1rem 1.5rem;
}

.spec-table td:first-child {
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   Configurator Styles
   ============================================ */
#configurator .room-item {
    animation: fadeIn 0.3s ease;
}

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

/* ============================================
   Pricing Calculator
   ============================================ */
.pricing-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.pricing-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--sp-accent);
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.4);
}

.pricing-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--sp-accent);
    cursor: pointer;
    border: none;
}

/* ============================================
   Responsive Utilities
   ============================================ */
@media (max-width: 768px) {
    #cart-panel {
        max-width: 100%;
    }
    
    .glass-card {
        backdrop-filter: blur(10px);
    }
}

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

::-webkit-scrollbar-track {
    background: var(--sp-darker);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .glass-card {
        background: white;
        border: 1px solid #ddd;
    }
    
    .cta-button {
        background: #0066cc;
        color: white;
    }
}
