/* --- ГЛОБАЛЬНЫЕ СТИЛИ --- */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a262f;
    color: #e0e0e0;
}

header {
    background-color: #141d24;
    border-bottom: 2px solid #00acc1;
    min-height: 70px;
    display: flex;
    align-items: center;
}

header .container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}
.logo span { color: #00acc1; }

.header-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Переключатель языков */
.lang-switch {
    list-style: none;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
}
.lang-switch a {
    text-decoration: none;
    color: #00acc1;
    font-size: 14px;
    font-weight: bold;
    padding: 6px 12px;
    border: 1px solid #00acc1;
    border-radius: 6px;
    transition: 0.3s;
}
.lang-switch a:hover, .lang-switch a.active {
    background: #00acc1;
    color: #fff;
}

/* Блок пользователя */
.user-area {
    display: flex;
    align-items: center;
    gap: 15px;
}
.logout-btn {
    color: #ff5252;
    text-decoration: none;
    font-weight: bold;
    border: 1px solid #ff5252;
    padding: 6px 15px;
    border-radius: 6px;
    transition: 0.3s;
}
.logout-btn:hover {
    background: #ff5252;
    color: #fff;
}

/* --- ГЛАВНАЯ СТРАНИЦА (INDEX) --- */
.hero {
    text-align: center;
    padding: 100px 20px;
    background: radial-gradient(circle at center, #2d5a61 0%, #1a262f 70%);
    min-height: 60vh;
}

.login-card {
    background: #24343d;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: inline-block;
    margin-top: 40px;
    width: 350px;
}

.login-card input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 6px;
    border: 1px solid #3e5a68;
    background: #1a262f;
    color: white;
    box-sizing: border-box;
}

.login-card button, .btn-primary {
    width: 100%;
    padding: 12px;
    background: #00acc1;
    border: none;
    color: white;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    text-decoration: none;
    display: inline-block;
}

.login-card button:hover, .btn-primary:hover { background: #008c9e; }

/* --- ЛИЧНЫЙ КАБИНЕТ (DASHBOARD) --- */
.dashboard-wrapper {
    display: flex;
    min-height: calc(100vh - 72px);
}

.sidebar {
    width: 250px;
    background: #141d24;
    border-right: 1px solid #2d414d;
    padding: 30px 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav a {
    display: block;
    padding: 15px 25px;
    color: #888;
    text-decoration: none;
    transition: 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover { color: #00acc1; background: #1a262f; }
.sidebar-nav a.active { border-left-color: #00acc1; color: #fff; background: #1a262f; }

.main-content {
    flex: 1;
    padding: 40px;
}

/* Поиск в кабинете */
.search-container {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.search-input {
    background: #141d24;
    border: 1px solid #00acc1;
    border-radius: 6px;
    padding: 12px 15px;
    color: #fff;
    width: 100%;
    max-width: 400px;
    outline: none;
}

.search-btn {
    background: #00acc1;
    border: none;
    border-radius: 6px;
    color: #fff;
    padding: 10px 30px;
    font-weight: bold;
    cursor: pointer;
}

/* Таблица результатов */
.results-table {
    width: 100%;
    border-collapse: collapse;
    background: #24343d;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

.results-table th {
    background: #00acc1;
    color: #fff;
    text-align: left;
    padding: 15px;
}

.results-table td {
    padding: 15px;
    border-bottom: 1px solid #3e5a68;
}

.results-table tr:hover {
    background: #2d5a61;
}

footer {
    text-align: center;
    padding: 20px;
    font-size: 14px;
    color: #555;
}

/* Поддержка RTL для Арабского */
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid #2d414d; }
[dir="rtl"] .sidebar-nav a { border-left: none; border-right: 3px solid transparent; }
[dir="rtl"] .sidebar-nav a.active { border-right-color: #00acc1; }

/* Сетка для карточек параметров */
.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.param-card {
    background: #24343d;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #2d414d;
    text-align: center;
    transition: 0.3s;
}

.param-card:hover { border-color: #00acc1; transform: translateY(-5px); }

.param-value {
    font-size: 32px;
    font-weight: bold;
    color: #00acc1;
    margin: 10px 0;
}

.param-label { color: #888; font-size: 14px; }

/* Календарь доступности (GitHub Style) */
.availability-calendar {
    background: #24343d;
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(53, 1fr); /* 53 недели */
    gap: 4px;
    margin-top: 15px;
}

.day-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.day-cell.green { background: #2ecc71; opacity: 0.8; }
.day-cell.red { background: #e74c3c; }

/* Тултип для календаря */
.day-cell:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

/* Имитатор выключателя (Toggle) */
.market-list {
    list-style: none;
    padding: 0;
}

.market-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #2d414d;
}

.toggle-switch {
    width: 40px;
    height: 20px;
    background: #444;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
}

.toggle-switch.on { background: #2ecc71; }
.toggle-switch.on::after { left: 22px; }

.toggle-switch::after {
    content: '';
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

/* Лоадер (Оверлей загрузки) */
#page-loader {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(20, 29, 36, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 172, 193, 0.2);
    border-top: 5px solid #00acc1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Календарь по месяцам */
.calendar-months-container {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.month-block { min-width: 180px; }

.month-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 10px;
    color: #888;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

/* Стили для активного переключателя */
.toggle-switch {
    width: 46px;
    height: 24px;
    background: #3e5a68;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-switch.on { background: #00acc1; }
.toggle-switch::after {
    content: '';
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 3px; left: 3px;
    transition: 0.3s;
}

.toggle-switch.on::after { left: 25px; }