/* === ПЕРЕМЕННЫЕ И ТЕМЫ (Light/Dark) === */
:root {
    --primary: #8a2be2;      
    --primary-light: #b19cd9; 
    --secondary: #00d4ff;    
    --secondary-light: #b3e0ff; 
    --success: #00ff88;
    --warning: #ffaa00;
    --danger: #ff4d4d;
    --info: #2b95e2;
    
    --bg-color: #0f0f23;
    --card-bg: rgba(138, 43, 226, 0.15);
    --text-main: #f0f0ff;
    --text-secondary: #a0a0c0;
    --modal-bg: rgba(15, 15, 35, 0.95);
    
    --gradient-primary: linear-gradient(135deg, #8a2be2, #00d4ff);
    --gradient-glass: linear-gradient(135deg, rgba(138, 43, 226, 0.15), rgba(0, 212, 255, 0.1));
}

[data-theme="light"] {
    --bg-color: #f4f4f9;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-secondary: #666;
    --modal-bg: rgba(255, 255, 255, 0.98);
    --gradient-glass: linear-gradient(135deg, #ffffff, #f0f0f5);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body { 
    background: var(--bg-color); color: var(--text-main);
    overflow-x: hidden; position: relative; min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

.card, .calculator-section, .hero, .profile-sidebar, .auth-box, .modal-content, .admin-product-form, .review-card {
    background: var(--card-bg) !important;
    color: var(--text-main);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

select option { background-color: var(--bg-color); color: var(--text-main); padding: 10px; }

.bg-animation {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2; opacity: 0.5;
    background-image: radial-gradient(circle at 10% 20%, rgba(138, 43, 226, 0.1) 0%, transparent 20%),
                      radial-gradient(circle at 90% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 20%);
}
.particle {
    position: absolute; border-radius: 50%; background: var(--primary-light);
    animation: float 15s infinite linear; opacity: 0.1;
}
@keyframes float {
    0% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-50px) translateX(-50px); }
    100% { transform: translateY(0) translateX(0); }
}

.container { max-width: 1200px; margin: 0 auto; padding: 20px; position: relative; z-index: 1; }

.btn { 
    padding: 12px 24px; border: none; border-radius: 10px; cursor: pointer; font-weight: 600; 
    transition: all 0.3s ease; position: relative; overflow: hidden; font-size: 0.95rem;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--gradient-primary); color: white; box-shadow: 0 5px 20px rgba(138, 43, 226, 0.3); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(138, 43, 226, 0.5); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-secondary { background: rgba(0, 212, 255, 0.1); border: 2px solid var(--secondary); color: var(--secondary); }
.btn-secondary:hover { background: var(--secondary); color: var(--text-main); }
.btn-danger { background: rgba(255, 77, 77, 0.1); border: 2px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: #000; }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

input, textarea, select { 
    width: 100%; padding: 14px; border: 1px solid rgba(138, 43, 226, 0.2); 
    background: rgba(138, 43, 226, 0.05); color: var(--text-main); border-radius: 10px; 
    margin-bottom: 15px; transition: 0.3s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); background: rgba(138, 43, 226, 0.1); }
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-secondary); }

[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea {
    background: #f0f0f0; color: #333; border-color: #ccc;
}
[data-theme="light"] .close-modal { color: #333; }

header { 
    background: rgba(15, 15, 35, 0.9); backdrop-filter: blur(10px); padding: 15px 0; 
    position: sticky; top: 0; z-index: 100; border-bottom: 1px solid rgba(138, 43, 226, 0.2);
}
[data-theme="light"] header { background: rgba(255, 255, 255, 0.95); border-bottom: 1px solid #ddd; }
[data-theme="light"] .logo { color: #333; }

.nav-content { display: flex; justify-content: space-between; align-items: center; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 1.8rem; font-weight: 800; color: var(--text-main); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.logo span { background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.user-badge {
    padding: 8px 16px; border-radius: 50px; font-size: 0.9rem; font-weight: 600;
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    background: var(--gradient-glass); border: 1px solid rgba(138, 43, 226, 0.3); transition: 0.3s;
}
.user-badge:hover { border-color: var(--primary); transform: translateY(-2px); }

.theme-toggle {
    background: transparent; border: 2px solid var(--primary); color: var(--primary);
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: 0.3s;
}
.theme-toggle:hover { background: var(--primary); color: white; }

.view { display: none; animation: fadeIn 0.5s ease; min-height: 70vh; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.hero { 
    text-align: center; padding: 80px 20px; border-radius: 20px; margin-bottom: 60px; border: 1px solid rgba(138, 43, 226, 0.3);
}
.hero h1 {
    font-size: 3.5rem; margin-bottom: 20px; background: linear-gradient(45deg, var(--text-main), var(--secondary));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-buttons { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }

.calculator-section { padding: 40px; border-radius: 20px; margin-bottom: 60px; border: 1px solid rgba(138, 43, 226, 0.2); }
.calculator-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.price-display { 
    font-size: 3.5rem; font-weight: 800; margin: 20px 0;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

.custom-checkbox {
    display: flex; align-items: center; cursor: pointer; margin-bottom: 10px; font-size: 0.9rem;
}
.custom-checkbox input { display: none; }
.custom-checkbox span { display: flex; align-items: center; gap: 8px; transition: 0.3s; color: var(--text-main); }
.custom-checkbox input:checked + span { color: var(--success); font-weight: bold; }
.custom-checkbox input:checked + span::before { content: '\f00c'; font-family: "Font Awesome 6 Free"; font-weight: 900; }

.mystery-box-container {
    display: flex; justify-content: space-between; align-items: center;
    padding: 30px; border-radius: 20px; margin-bottom: 40px; cursor: pointer;
    background: linear-gradient(135deg, #8a2be2, #4b0082) !important;
    color: white !important; border: 2px solid #ffaa00; position: relative; overflow: hidden;
    transition: transform 0.3s; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.mystery-box-container:hover { transform: scale(1.02); box-shadow: 0 0 20px #ffaa00; }
.mb-icon { font-size: 5rem; font-weight: 800; opacity: 0.3; transform: rotate(15deg); }
.mb-price { font-size: 1.5rem; font-weight: bold; background: #ffaa00; color: black; padding: 5px 15px; border-radius: 10px; display: inline-block; margin-top: 10px; }

.reviews-slider { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 60px; }
.review-card { padding: 20px; border-radius: 15px; border: 1px solid rgba(138, 43, 226, 0.2); }
.review-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.review-stars { color: var(--warning); }
.rating-select { display: flex; gap: 10px; font-size: 1.5rem; color: var(--text-secondary); cursor: pointer; margin-bottom: 10px; }
.rating-select .active { color: var(--warning); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; margin-bottom: 60px; }
.card { 
    border-radius: 16px; overflow: hidden; transition: 0.4s; 
    border: 1px solid rgba(138, 43, 226, 0.1);
}
.card:hover { transform: translateY(-10px); border-color: var(--primary); }
.card-img { width: 100%; height: 250px; object-fit: cover; }
.card-body { padding: 25px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.card-price { font-weight: 800; font-size: 1.5rem; color: var(--secondary); }

.auth-box { max-width: 500px; margin: 60px auto; border-radius: 20px; padding: 40px; border: 1px solid rgba(138, 43, 226, 0.3); }
.auth-tabs { display: flex; margin-bottom: 30px; border-bottom: 1px solid rgba(138, 43, 226, 0.2); }
.auth-tab {
    flex: 1; text-align: center; padding: 15px; background: transparent; border: none;
    color: var(--text-secondary); font-weight: 600; cursor: pointer;
}
.auth-tab.active { color: var(--primary); border-bottom: 3px solid var(--primary); }
.auth-form { display: none; }
.auth-form.active { display: block; }

.profile-view { display: grid; grid-template-columns: 300px 1fr; gap: 40px; margin-top: 30px; }
.profile-sidebar { border-radius: 20px; padding: 30px; border: 1px solid rgba(138, 43, 226, 0.2); }
.user-avatar { 
    width: 100px; height: 100px; border-radius: 50%; background: var(--gradient-primary); 
    display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin: 0 auto 20px; color: white; 
}

.status-badge { padding: 5px 10px; border-radius: 5px; font-size: 0.8rem; font-weight: bold; }
.status-new { color: var(--info); border: 1px solid var(--info); background: rgba(43, 149, 226, 0.1); }
.status-processing { color: var(--warning); border: 1px solid var(--warning); background: rgba(255, 170, 0, 0.1); }
.status-done { color: var(--success); border: 1px solid var(--success); background: rgba(0, 255, 136, 0.1); }
.status-canceled { color: var(--danger); border: 1px solid var(--danger); background: rgba(255, 77, 77, 0.1); }

.admin-product-form { padding: 20px; border-radius: 15px; margin-bottom: 30px; border: 1px solid rgba(138, 43, 226, 0.3); }
.admin-product-item {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(0, 0, 0, 0.3); padding: 10px; margin-bottom: 10px;
    border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.1);
}
.admin-product-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 5px; margin-right: 15px; }
.admin-product-info { flex: 1; display: flex; align-items: center; }

/* FOOTER */
.main-footer {
    border-top: 1px solid rgba(138, 43, 226, 0.2);
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
    color: var(--text-secondary);
}
.footer-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; transition: 0.3s; }
.footer-links a:hover { color: var(--primary); }
.footer-links span { margin: 0 10px; color: rgba(255,255,255,0.1); }
.footer-copyright { margin-top: 15px; font-size: 0.8rem; opacity: 0.7; }

.ar-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 15, 35, 0.98); z-index: 2000;
    display: none; flex-direction: column;
}
.ar-container { flex: 1; display: flex; justify-content: center; align-items: center; position: relative; }
model-viewer { width: 100%; height: 100%; background-color: #1a1a2e; --poster-color: transparent; }
.ar-controls {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.5); padding: 10px 20px; border-radius: 30px; pointer-events: none;
}
.ar-btn {
    background-color: white; border-radius: 20px; border: none; 
    position: absolute; bottom: 20px; right: 20px; padding: 10px 20px;
    font-weight: bold; color: black; display: flex; align-items: center; gap: 5px;
}

.modal { 
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center; backdrop-filter: blur(5px);
}
.modal-content { 
    background: var(--modal-bg); padding: 40px; border-radius: 20px; width: 90%; max-width: 600px; 
    position: relative; border: 1px solid rgba(138, 43, 226, 0.3); max-height: 90vh; overflow-y: auto;
}
.close-modal { position: absolute; right: 20px; top: 20px; cursor: pointer; font-size: 1.8rem; color: var(--primary); }

.notification {
    position: fixed; top: 20px; right: 20px; padding: 15px 25px; border-radius: 10px;
    background: rgba(138, 43, 226, 0.9); color: white; z-index: 3000; display: none; animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 768px) {
    .profile-view, .calculator-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.2rem; }
    .ar-controls { width: 90%; text-align: center; font-size: 0.8rem; }
}
