/* =================================================================== */
/* GLOBAL STYLES & DESIGN SYSTEM                                       */
/* =================================================================== */

:root {
    /* --- НОВАЯ СИНЯЯ ЦВЕТОВАЯ СХЕМА --- */
    --main-bg: #0d1117;           /* Очень темный, почти черный фон с синим оттенком */
    --raised-bg: #161b22;         /* Графитовый фон для карточек и окон */
    --text-color: #c9d1d9;        /* Светло-серый, почти белый текст */
    --hint-color: #8b949e;        /* Приглушенный серо-синий для подсказок */
    --accent-color: #388bfd;      /* Яркий, насыщенный синий для кнопок и акцентов */
    --accent-text-color: #ffffff; /* Белый текст на кнопках */

    /* Единый радиус скругления для всего приложения */
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--main-bg);
    color: var(--text-color);
    overscroll-behavior: none;
}
.view { display: none; width: 100%; min-height: 100vh; flex-direction: column; }
.view.active { display: flex; }

/* =================================================================== */
/* HEADER & TABS                                                       */
/* =================================================================== */

.header {
    background-color: var(--main-bg);
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-bottom: 1px solid var(--raised-bg);
}

.tabs {
    display: flex;
    flex-grow: 1;
}

.tab-link {
    flex-grow: 1;
    padding: 16px;
    border: none;
    background-color: transparent;
    color: var(--hint-color);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
    border-radius: 0;
}

.tab-link.active {
    color: var(--text-color);
    background-color: var(--raised-bg);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    transform: translateY(1px);
}

.add-btn {
    background: none; border: none; color: var(--accent-color);
    font-size: 32px; font-weight: normal; padding: 0 15px; cursor: pointer;
    position: relative; z-index: 11; display: none;
}

/* =================================================================== */
/* CONTENT & LISTS                                                     */
/* =================================================================== */

.content {
    flex-grow: 1;
    position: relative;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.scroll-list {
    height: calc(100vh - 59px);
    overflow-y: auto;
    padding: 10px;
}

.list-item {
    display: flex;
    align-items: center;
    background-color: var(--raised-bg);
    padding: 12px;
    margin-bottom: 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: transform 0.15s ease-in-out;
}
.list-item:active {
    transform: scale(0.98);
}

.list-item-photo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 12px;
    background-color: var(--main-bg);
}

.list-item-content { flex-grow: 1; }
.list-item-name { font-size: 16px; font-weight: 500; }
.list-item-price { font-weight: bold; color: var(--accent-color); font-size: 16px; }
.countdown-timer { font-size: 13px; color: var(--hint-color); margin-top: 4px; }


/* =================================================================== */
/* DETAIL VIEW                                                         */
/* =================================================================== */

#detail-view { padding: 15px; padding-bottom: 100px; }
#detail-view .back-btn { font-size: 16px; font-weight: bold; color: var(--accent-color); background: none; border: none; padding: 5px 0; margin-bottom: 15px; cursor: pointer; }
#detail-view h1 { font-size: 24px; margin: 0 0 10px 0; }
.price, .bid-info { font-size: 20px; font-weight: bold; margin-bottom: 15px; }
.bid-info span { display: block; font-size: 14px; font-weight: normal; color: var(--hint-color); }
#detail-view .about { line-height: 1.5; margin-bottom: 20px; }

/* Карусель */
.carousel-container { position: relative; width: 100%; aspect-ratio: 1 / 1; margin: 0 auto 15px; overflow: hidden; border-radius: var(--border-radius); background-color: var(--main-bg); }
.carousel-track { display: flex; height: 100%; transition: transform 0.3s ease-in-out; }
.carousel-slide { flex-shrink: 0; width: 100%; height: 100%; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.3); color: white; border: none; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 20px; z-index: 1; display: flex; align-items: center; justify-content: center; }
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; z-index: 1; }
.carousel-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.5); margin: 0 4px; cursor: pointer; transition: background 0.2s; }
.carousel-dot.active { background: white; }

/* =================================================================== */
/* ACTION AREA & BUTTONS                                               */
/* =================================================================== */

.action-button-container {
    position: fixed;
    bottom: 0; left: 0; right: 0; padding: 15px;
    background: linear-gradient(to top, var(--main-bg) 70%, transparent);
}

/* Общий стиль для всех ярких кнопок */
.action-button, .bid-submit-btn, .submit-btn {
    width: 100%; padding: 15px; border: none;
    font-size: 18px; font-weight: bold; cursor: pointer; text-align: center;
    background-color: var(--accent-color);
    color: var(--accent-text-color);
    border-radius: var(--border-radius);
    transition: all 0.2s ease-in-out;
}
.action-button:active, .bid-submit-btn:active, .submit-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.bid-input-area { display: flex; gap: 10px; width: 100%; }
.bid-input {
    width: 60%; flex-grow: 1; padding: 15px;
    border: 1px solid var(--hint-color);
    font-weight: bold; background-color: var(--raised-bg);
    color: var(--text-color); text-align: center; font-size: 18px;
    border-radius: var(--border-radius);
}
.bid-input::placeholder { color: var(--hint-color); }
.bid-input::-webkit-outer-spin-button, .bid-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bid-input[type=number] { -moz-appearance: textfield; }

.bid-submit-btn { width: 40%; padding: 15px 0; }
.action-button.disabled { background-color: #6c757d; }

/* =================================================================== */
/* MODAL & ADMIN SECTIONS                                              */
/* =================================================================== */

.modal {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: fixed; 
    z-index: 20;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    
    /* В скрытом состоянии окно прозрачно и НЕ ПЕРЕХВАТЫВАЕТ клики */
    opacity: 0;
    pointer-events: none; 
    transition: opacity 0.2s ease-in-out;
    padding: 5vh 0;
    overflow-y: auto;
}
.modal.visible {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background-color: var(--raised-bg);
    border-radius: var(--border-radius);
    padding: 20px; width: 90%; max-width: 500px;
    max-height: 90vh; overflow-y: auto;
}

.bidders-section {
    background-color: var(--raised-bg);
    border-radius: var(--border-radius);
    padding: 15px; margin-top: 20px;
}
.close-btn { color: var(--hint-color); float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; color: var(--hint-color); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px;
    background-color: var(--bg-color);
    border: 1px solid var(--hint-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 16px;
}
.type-fields { display: none; }

.bidders-section h3 { margin: 0 0 10px 0; font-size: 18px; }
.bidders-list { font-size: 15px; line-height: 1.6; }
.bidders-list div { display: flex; justify-content: space-between; }
.bidders-list .username { color: var(--hint-color); }
.bidders-list .bid-amount { font-weight: 500; }

.admin-only {
    display: none;
}

/* style.css */

/* --- Стили для таблицы пользователей --- */
.users-table {
    width: 100%;
    border-collapse: collapse; /* Убираем двойные рамки */
    font-size: 15px;
}

.users-table th, .users-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--main-bg); /* Разделительная линия */
}

.users-table th {
    font-weight: 500;
    color: var(--hint-color);
}

/* --- Главное правило для "зебры" --- */
.users-table tr:nth-child(even) {
    background-color: var(--raised-bg); /* Закрашиваем каждый четный ряд */
}
/* style.css */

/* --- Стиль для кнопки удаления --- */
.delete-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Делаем ее круглой */
    background-color: #dc3545; /* Красный цвет */
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: transform 0.2s;
}
.delete-btn:active {
    transform: scale(0.9);
}
.edit-btn { /* Стиль для кнопки редактирования */
    position: absolute;
    top: 15px;
    right: 65px; /* Располагаем левее кнопки удаления */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #0d6efd; /* Синий цвет */
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: transform 0.2s;
}
.edit-btn:active {
    transform: scale(0.9);
}

/* Стили для поиска и кнопок бана */
.search-bar {
    padding: 0 10px 15px 10px;
}
#user-search-input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--hint-color);
    background-color: var(--raised-bg);
    color: var(--text-color);
    font-size: 16px;
}

.ban-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 500;
}
.ban-btn.ban {
    background-color: #dc3545; /* Красный */
}
.ban-btn.unban {
    background-color: #198754; /* Зеленый */
}
.username-link {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}
.username-link:hover {
    text-decoration: underline;
}

.price-block {
    margin-bottom: 15px;
}

.stop-price {
    font-size: 14px;
    color: var(--hint-color);
    margin-top: 4px; /* Убираем отрицательный отступ и делаем небольшой положительный */
}