/* Общие стили для единого сайта */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* Запрет выделения текста */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Разрешаем выделение для полей ввода и редактируемых элементов */
input,
textarea,
select,
[contenteditable="true"],
[contenteditable="true"] * {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* =============================================
   Общий фон для всего сайта
   ============================================= */
body {
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    padding-bottom: 40px;
    /* Единый фон для всех страниц */
    background-image: url('/static/img/sparkles-background.svg'), url('/static/img/Vector.svg');
    background-repeat: no-repeat;
    background-size: contain, cover;
    background-position: 100% 0, 100% 0;
    background-color: #7231FF;
    background-attachment: scroll;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Для страниц с base.html используем flex layout */
body:has(.site-header) {
    display: flex;
    flex-direction: column;
}

body:has(.site-header) > .main-content {
    flex: 1;
}

.main-content {
    flex: 1;
    padding: 0;
    position: relative;
    z-index: 1;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* =============================================
   Шапка сайта
   ============================================= */

/* Bootstrap шапка (для страниц с base.html) */
.site-header {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
}

.navbar {
    position: relative;
    z-index: 1;
}

body > .container,
body > header .container {
    position: relative;
    z-index: 1;
}

/* Glassmorphism навигация (для калькулятора, главной и других страниц) */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    margin-top: 20px;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
    /* Glassmorphism Effect */
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 2px solid rgba(255, 255, 255, 1);
    border-radius: 50px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 30px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.nav-link i {
    font-size: 16px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.15);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Стили для иконки корзины - применяются ко всем страницам */
.nav-cart i.fa-shopping-cart,
.nav-cart .fa-shopping-cart,
.nav-cart i,
.nav-actions .nav-cart i,
.nav-actions .nav-cart .fa-shopping-cart,
i.fa-shopping-cart {
    box-sizing: content-box !important;
    margin-top: 2px !important;
    margin-right: 1px !important;
    margin-left: 0 !important;
    margin-bottom: 0 !important;
    display: inline-block !important;
    vertical-align: middle !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Иконка аккаунта - круглая */
.nav-actions .nav-link {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

.nav-actions .nav-link span {
    display: none;
}

.nav-actions .nav-link i {
    margin: 0;
    font-size: 18px;
}

/* Аватар в навигации */
.nav-actions .nav-link img {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    object-fit: cover;
    border-radius: 50%;
}

.nav-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 18px;
    border-radius: 50%;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.nav-cart:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #FF4444;
    color: white;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-sizing: border-box;
    line-height: 18px;
    text-align: center;
}

/* =============================================
   Подвал сайта
   ============================================= */

/* Bootstrap подвал (для страниц с base.html) */
.site-footer {
    border-top: 1px solid #dee2e6;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

/* Glassmorphism подвал (для калькулятора, главной и других страниц) */
.footer {
    margin-top: 40px;
    position: relative;
    z-index: 1;
    /* Glass Effect - светлое стекло с blur */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 2px solid rgba(255, 255, 255, 1);
    border-radius: 30px;
    padding: 28px 32px;
    color: white;
    box-shadow: 
        0 -4px 30px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 32px;
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    gap: 8px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.footer-social {
    display: flex;
    gap: 10px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 20px;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-2px);
}

.footer-copyright {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Шаги формы */
.steps-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    align-items: center;
    margin: 0 1rem;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 0.5rem;
}

.step.active .step-number {
    background: var(--primary-color);
}

.step.completed .step-number {
    background: var(--success-color);
}

.step-label {
    font-weight: 500;
}

.step-connector {
    width: 50px;
    height: 2px;
    background: var(--secondary-color);
    margin: 0 0.5rem;
}

.step.completed + .step-connector {
    background: var(--success-color);
}

/* Формы */
.form-card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.option-button {
    padding: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.option-button:hover {
    border-color: var(--primary-color);
    background: #f8f9ff;
}

.option-button.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Загрузка файлов */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: #f8f9ff;
}

.file-upload-area.dragover {
    border-color: var(--success-color);
    background: #f0fff4;
}

/* =============================================
   Единая система уведомлений
   ============================================= */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 10010;
    animation: slideInNotification 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: fit-content;
    max-width: 400px;
    word-wrap: break-word;
}

/* Успешные операции */
.notification.success {
    background: #4CAF50;
}

/* Ошибки */
.notification.error {
    background: #F44336;
}

/* Предупреждения */
.notification.warning {
    background: #FFC107;
}

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

/* Кнопки */
.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 768px) {
    .steps-container {
        flex-direction: column;
        align-items: center;
    }
    
    .step-connector {
        width: 2px;
        height: 30px;
        margin: 0.5rem 0;
    }
    
    .option-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Предотвращение мигания аватарки */
/* Иконка должна быть видна для неавторизованных пользователей */
#account-link {
    opacity: 1 !important;
    transition: opacity 0.1s ease;
}

/* Показываем когда аватарка загружена */
#account-link.account-link-avatar,
#account-link.account-link-avatar img {
    opacity: 1;
    transition: opacity 0.1s ease;
}

