@import url(//fonts.googleapis.com/css?family=PT+Sans&subset=latin,cyrillic);

/* Глобальные стили */
* {
    margin: 0;
    padding: 0;
    font-family: 'PT Sans', sans-serif;
    font-size: 14px;
    color: #373737; /* Светлая тема по умолчанию */
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    min-width: 1000px;
    font-family: 'PT Sans', sans-serif;
    overflow-x: hidden; /* предотвращает случайный горизонтальный скролл */
}

/* Типография */
h1 {
    font-size: 24px;
}

h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

h3 {
    font-size: 20px;
}

small {
    font-size: 11px;
}

/* Ссылки */
a {
    color: #0a701f;
    text-decoration: none;
    font-size: 14px;
    transition: all .3s ease-in-out;
}

a:link {
    text-decoration: none;
}

a:visited {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: #c7261e;
}

a.inactive {
    color: gray;
}

a.menu {
    font-size: 14px;
}

/* Специальные классы */
.today {
    color: green;
}

/* Макет */
.wrap {
    font-size: 14px;
    position: relative;
    margin: 10px auto;
    width: 1000px;
    padding: 10px 10px 10px 75px;
    /*box-shadow:  0 0 17px rgba(190,190,190,3);
    -webkit-box-shadow: 0 0 17px rgba(190,190,190,3);
    -moz-box-shadow: 0 0 17px rgba(190,190,190,3);*/
}

.content {
    position: relative;
    width: 900px;
    padding: 5px;
    margin: 5px;
}

.clear {
    clear: both;
}

/* Навигация */
.prev,
.next {
    position: absolute;
    top: 15px;
}

.prev a,
.next a {
    font-size: 13px;
}

.prev {
    left: 5px;
}

.next {
    right: 5px;
}

.modeslinks {
    text-align: right;
    font-size: 11px;
    padding-right: 10px;
}

.modeslinks > small > a,
.modeslinks > small > u {
    font-size: 11px;
}

.modeslinks > small > u {
    font-weight: bold;
}

/* Переключатель классов - "УМНОЕ" ПОЗИЦИОНИРОВАНИЕ */
.class-switcher {
    position: absolute; /* По умолчанию absolute */
    left: -15px;
    top: 50px;
    display: flex;
    flex-direction: column;
    gap: 60px;
    z-index: 10;
    transition: top 0.2s ease-out; /* Плавный переход */
}

/* Когда переключатель становится sticky */
.class-switcher.sticky {
    position: fixed;
    top: 5px; /* 5px от верха экрана */
    left: calc(50% - 500px - 15px); /* Центрирование относительно .wrap */
}

.class-switcher a {
    padding: 10px 20px;
    background: #f5f5f5;
    border: 1px solid #0a701f;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    transform: rotate(-90deg);
    transform-origin: right bottom;
    margin-left: -15px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    color: #373737;
    font-weight: normal;
}

.class-switcher a:hover {
    background: #0a701f;
    color: white;
    transform: rotate(-90deg) translateX(5px);
}

.class-switcher a.active {
    background: #0a701f;
    color: white;
    font-weight: bold;
    transform: rotate(-90deg);
}

/* Боковая кнопка Donate - "УМНОЕ" ПОЗИЦИОНИРОВАНИЕ */
.donate-button-wrapper {
    position: absolute; /* По умолчанию absolute */
    left: -36px;
    top: 280px;
    z-index: 11;
    width: 100px;
    transition: top 0.2s ease-out; /* Плавный переход */
}

/* Когда кнопка становится sticky */
.donate-button-wrapper.sticky {
    position: fixed;
    top: 235px; /* 5px от верха + высота переключателей */
    left: calc(50% - 500px - 36px); /* Центрирование относительно .wrap */
}

#donate-button {
    display: block;
    padding: 8px 5px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-weight: bold;
    font-size: 16px;
    border: 2px solid #FF8C00;
    border-radius: 5px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.5);
    transition: all 0.3s ease;
    transform: rotate(-90deg);
    transform-origin: right bottom;
    animation: glow-pulse 2s infinite;
    white-space: nowrap;
}

#donate-button:hover {
    background: linear-gradient(135deg, #FFA500 0%, #FFD700 100%);
    box-shadow: 0 6px 25px rgba(255, 165, 0, 0.9);
    transform: rotate(-90deg) translateX(8px);
    text-decoration: none;
    animation: none;
}

#donate-button:active {
    transform: rotate(-90deg) translateX(3px);
    box-shadow: 0 2px 10px rgba(255, 165, 0, 0.7);
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 2px 5px rgba(255, 165, 0, 0.5), 0 0 5px rgba(255, 165, 0, 0.3);
    }
    50% {
        box-shadow: 0 2px 10px rgba(255, 165, 0, 1), 0 0 10px rgba(255, 165, 0, 0.6);
    }
}

/* Формы и инпуты */
input[type="checkbox"] {
    vertical-align: middle;
}

select,
input[type="submit"],
button {
    border: 1px solid gray;
    padding: 5px;
    border-radius: 4px;
}

select:hover,
input[type="submit"]:hover,
button:hover {
    border-color: #666;
}

select:focus,
input:focus,
button:focus {
    outline: none;
    border-color: #777;
}

/* Таблицы */
.statlist {
    width: 100%;
}

table {
    text-align: left;
}

.stattable {
    min-width: 100%;
    border-spacing: 0px;
    border-collapse: collapse;
    font-family: verdana;
    font-size: 12px;
}

.stattable.th,
.stattable th {
    /*...*/
}

.stattable td {
    padding: 0px;
    position: relative;
}

td span {
    float: right;
    display: none;
}

tr:hover span {
    display: inline-block;
}

tr:nth-child(2n) {
    background: #f5f5f5;
}

/* Изображения */
.imgbox {
    display: inline-block;
    padding: 5px;
    margin: 5px;
    border: 1px solid gray;
}

/* Переключатель темы */
#theme-toggle {
    cursor: pointer;
}

/* ПРЕЛОАДЕР */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: gray; /* Светлый фон по умолчанию */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Выше всего остального */
    transition: opacity 0.5s ease; /* Плавное исчезновение */
}

#preloader img {
    width: 96px;
    height: 96px;
    animation: spin 2s linear infinite; /* Анимация вращения */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Stats styles */
.stats-section {
    margin-bottom: 40px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stats-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-card h3 {
    margin: 0 0 10px;
    font-size: 1.2em;
}

.tabs {
    overflow: hidden;
    border-bottom: 1px solid #ccc;
    margin-bottom: 20px;
}

.tab-button {
    background-color: #f1f1f1;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: 0.3s;
    float: left;
}

.tab-button:hover {
    background-color: #ddd;
}

.tab-button.active {
    background-color: #ccc;
}

.tab-content {
    display: none;
    padding: 6px 12px;
    position: relative;
}

.toggle-buttons {
    margin-top: 10px;
    text-align: center;
}

.toggle-buttons button {
    margin: 0 5px;
    padding: 5px 10px;
    cursor: pointer;
}

.scroll-table {
    max-height: 400px;
    overflow-y: auto;
    position: relative;
}

.scroll-table-abs {
    z-index: 1;
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 873px;
    height: 50px;
    margin: 0 12px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
}

/* Pilot Profile styles */
.pilot-profile {
    max-width: 1200px;
    margin: 0 auto;
}

.pilot-col-left,
.pilot-col-right {
    float: left;
    width: 48%;
    margin-right: 2%;
}

.pilot-col-right {
    margin-right: 0;
}

.pilot-stats table td:first-child {
    font-weight: bold;
    width: 50%;
}

/* Sort arrow styles */
.sort-arrow {
    font-size: 0.8em;
    margin-left: 5px;
}

.sort-arrow.asc::after {
    content: "↑";
}

.sort-arrow.desc::after {
    content: "↓";
}

.sort-arrow.unsorted::after {
    content: "↕";
}

th:hover {
    background-color: #f0f0f0;
}

/* Базовые стили переключателя языка */
.lang-switch {
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-block;
}

/* === ДЛЯ СВЕТЛОЙ ТЕМЫ (light.css) === */
.lang-switch {
    color: #0066cc;
    background: rgba(0, 102, 204, 0.1);
}

.lang-switch:hover {
    background: rgba(0, 102, 204, 0.2);
    transform: translateY(-1px);
}

/* === ДЛЯ ТЕМНОЙ ТЕМЫ (dark.css) === */
/* Добавить следующее в dark.css: */

body.highcharts-dark .lang-switch {
    color: #4da6ff;
    background: rgba(77, 166, 255, 0.1);
}

body.highcharts-dark .lang-switch:hover {
    background: rgba(77, 166, 255, 0.2);
    transform: translateY(-1px);
}

/* Дополнительные стили для адаптивности */
@media (max-width: 768px) {
    .lang-switch {
        padding: 4px 10px;
        font-size: 14px;
    }
}
