/* static/style.css - полные стили без внешних подключений */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* ========== НАВИГАЦИЯ ========== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.logo:hover {
    color: #764ba2;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: #333;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-link:hover {
    background: #667eea;
    color: white;
}

/* ========== КОНТЕЙНЕР ========== */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ========== КАРТОЧКИ ========== */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-out;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
}

.card-header h2,
.card-header h3,
.card-header h4 {
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* ========== ФОРМЫ ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='4.5' stroke='%23dc3545'/%3E%3Cpath stroke='%23dc3545' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 5px;
}

.form-check {
    margin-bottom: 10px;
}

.form-check-input {
    margin-right: 8px;
}

/* ========== КНОПКИ ========== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.875rem;
}

/* ========== ТАБЛИЦЫ ========== */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* ========== БЕЙДЖИ ========== */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #333;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

/* ========== УВЕДОМЛЕНИЯ ========== */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
}

.alert-close:hover {
    opacity: 1;
}

/* ========== ГЛАВНАЯ СТРАНИЦА ========== */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.feature-card ul {
    text-align: left;
    padding-left: 20px;
    margin-top: 15px;
}

.feature-card li {
    margin: 10px 0;
}

/* ========== ДАШБОРД ========== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

/* ========== ПРЕДПОЧТЕНИЯ ========== */
.preferences-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.preferences-card .form-check-label {
    color: white;
}

.preferences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

/* ========== АНИМАЦИИ ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }

    .table {
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 8px;
    }

    .features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .card-body {
        padding: 15px;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

.badge-revision {
    background: #f39c12;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

/* Навигация: непрочитанные в чатах */
.nav-link-with-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-unread-badge {
    background: #e74c3c;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Список чатов /chats */
.chats-page-header {
    margin-bottom: 20px;
    color: #fff;
}

.chats-page-header h2 {
    font-size: 1.75rem;
    margin-bottom: 6px;
}

.chats-page-sub {
    opacity: 0.92;
    font-size: 0.95rem;
}

.chats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-row {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.chat-row-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    position: relative;
    min-width: 0;
}

.chat-row-main:hover {
    background: #f8f9ff;
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-row-body {
    flex: 1;
    min-width: 0;
}

.chat-row-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.chat-order-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #2c3e50;
}

.badge-order-status {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: #e8eaf6;
    color: #3949ab;
    font-weight: 600;
}

.chat-row-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 6px;
}

.chat-other-name {
    font-weight: 600;
    color: #444;
}

.chat-last-time {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: #888;
}

.chat-last-preview {
    font-size: 0.9rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-unread-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-row-hide {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-left: 1px solid #eee;
}

.btn-hide-chat {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.45;
    padding: 8px;
    border-radius: 8px;
}

.btn-hide-chat:hover {
    opacity: 1;
    background: #fce4ec;
}

@media (max-width: 600px) {
    .chat-last-preview {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}
















/* Дополнительные стили для страницы верификации */
.verification-info {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

.verification-info p {
    margin-bottom: 8px;
}

.verification-info strong {
    color: #667eea;
}

#code {
    font-size: 1.3rem;
    text-align: center;
    letter-spacing: 8px;
    font-weight: 600;
    font-family: monospace;
    background: #f8f9fa;
}

#code:focus {
    letter-spacing: 8px;
    background: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid #667eea;
    color: #667eea;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Анимация для карточки */
.card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
