/* Стили для страницы недельных активностей */

.week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.week-header h1 {
    margin: 0;
    font-size: 1.5em;
    color: #ffd700;
}

.week-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.week-info {
    color: #aaa;
    font-size: 14px;
    white-space: nowrap;
}

/* Вкладки */
.tabs {
    display: flex;
    gap: 8px;
    margin: 15px 0 20px 0;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
    border: 1px solid #444;
    padding: 10px 24px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
}

.tab-btn.active {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

/* Таблица */
.week-table-wrapper {
    overflow-x: auto;
    margin: 15px 0;
    border-radius: 12px;
    border: 1px solid #444;
}

.week-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 700px;
    user-select: none;
}

.week-table th {
    background: #2a2a3a;
    color: #ffd700;
    padding: 12px 10px;
    text-align: center;
    font-weight: bold;
    border-bottom: 2px solid #444;
    white-space: nowrap;
}

.week-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #333;
    vertical-align: middle;
}

/* Заголовки групп */
.week-table .group-header td {
    background: rgba(255, 215, 0, 0.08);
    color: #ffd700;
    font-weight: bold;
    padding: 8px 10px;
    text-align: left;
    font-size: 13px;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
}

.week-table .group-header .group-name {
    display: inline-block;
    padding-left: 15px;
}

.week-table .group-header .group-controls {
    float: right;
    display: flex;
    align-items: center;
    gap: 10px;
}

.week-table .group-header .group-controls .add-input {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #2a2a3a;
    color: white;
    font-size: 12px;
    width: 130px;
}

.week-table .group-header .group-controls .add-input:focus {
    outline: none;
    border-color: #ffd700;
}

.week-table .group-header .group-controls .add-btn {
    background: #4caf50;
    color: white;
    border: none;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

.week-table .group-header .group-controls .add-btn:hover {
    opacity: 0.85;
}

.week-table .col-nick {
    text-align: left;
    padding-left: 15px;
    font-weight: bold;
    color: #ddd;
    white-space: nowrap;
    min-width: 120px;
}

/* Статусы */
.week-table .col-status {
    text-align: center;
    font-size: 20px;
    cursor: pointer;
    min-width: 50px;
    transition: opacity 0.2s;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.week-table .col-status:hover {
    opacity: 0.7;
}

.week-table .col-status.status-0 {
    color: #ff4444;
}

.week-table .col-status.status-1 {
    color: #4caf50;
}

/* Башня - специальные стили для чисел */
.week-table .col-tower {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    min-width: 50px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: opacity 0.2s;
}

.week-table .col-tower:hover {
    opacity: 0.7;
}

.week-table .col-tower.tower-no {
    color: #ff4444;
}

.week-table .col-tower.tower-wait {
    color: #ff9800;
}

.week-table .col-tower.tower-normal {
    color: #4caf50;
}

.week-table .col-tower.tower-gold {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    border-radius: 8px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    font-size: 20px;
}

.week-table .col-prof {
    text-align: left;
    padding-left: 10px;
    min-width: 80px;
}

.week-table .col-prof input {
    background: transparent;
    border: 1px solid #444;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    width: 100%;
    max-width: 100px;
    font-size: 13px;
}

.week-table .col-prof input:focus {
    outline: none;
    border-color: #ffd700;
}

/* Строка итогов */
.week-table .total-row td {
    background: #1a1a2e;
    color: #ffd700;
    font-weight: bold;
    padding: 12px 10px;
    border-top: 2px solid #ffd700;
}

.week-table .total-row .col-nick {
    color: #ffd700;
}

/* КВМ Секция */
.kvm-section {
    margin: 20px 0;
    padding: 15px 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    border: 1px solid #444;
}

.kvm-section h3 {
    margin: 0 0 12px 0;
    color: #ffd700;
    font-size: 16px;
}

.kvm-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.kvm-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kvm-item label {
    color: #ccc;
    font-weight: bold;
    font-size: 14px;
    margin: 0;
}

.kvm-item input {
    width: 80px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #2a2a3a;
    color: white;
    font-size: 14px;
    text-align: center;
}

.kvm-item input:focus {
    outline: none;
    border-color: #ffd700;
}

.kvm-total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #444;
    text-align: center;
    font-size: 16px;
    color: #ffd700;
}

.kvm-total strong {
    font-size: 20px;
    color: #4caf50;
}

/* Иномир */
.otherworld-section {
    margin: 20px 0;
}

.otherworld-cloud {
    position: relative;
    padding: 30px 40px;
    border-radius: 20px;
    background: linear-gradient(135deg, #1a0533, #2d1b69, #1a0533);
    background-size: 200% 200%;
    animation: cloudPulse 4s ease-in-out infinite;
    text-align: center;
    overflow: hidden;
    border: 1px solid rgba(138, 43, 226, 0.3);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes cloudPulse {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.otherworld-cloud .particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.otherworld-cloud .particle {
    position: absolute;
    color: rgba(200, 150, 255, 0.6);
    font-size: 14px;
    animation: particleFloat 6s ease-in-out infinite;
}

.particle:nth-child(1) { top: 10%; left: 5%; animation-delay: 0s; font-size: 12px; }
.particle:nth-child(2) { top: 20%; right: 10%; animation-delay: 0.8s; font-size: 16px; }
.particle:nth-child(3) { bottom: 15%; left: 15%; animation-delay: 1.6s; font-size: 10px; }
.particle:nth-child(4) { bottom: 25%; right: 5%; animation-delay: 2.4s; font-size: 18px; }
.particle:nth-child(5) { top: 50%; left: 30%; animation-delay: 3.2s; font-size: 14px; }
.particle:nth-child(6) { top: 40%; right: 25%; animation-delay: 0.4s; font-size: 11px; }
.particle:nth-child(7) { bottom: 40%; left: 45%; animation-delay: 1.2s; font-size: 15px; }
.particle:nth-child(8) { top: 70%; right: 35%; animation-delay: 2.0s; font-size: 13px; }

@keyframes particleFloat {
    0%, 100% { transform: translateY(0px) scale(1); opacity: 0.6; }
    25% { transform: translateY(-10px) scale(1.2); opacity: 1; }
    50% { transform: translateY(5px) scale(0.8); opacity: 0.8; }
    75% { transform: translateY(-5px) scale(1.1); opacity: 0.9; }
}

.otherworld-content {
    position: relative;
    z-index: 1;
}

.otherworld-title {
    font-size: 28px;
    font-weight: bold;
    color: #d4bfff;
    text-shadow: 0 0 20px rgba(138, 43, 226, 0.5), 0 0 40px rgba(138, 43, 226, 0.3);
    letter-spacing: 3px;
    margin-bottom: 8px;
}

.otherworld-info {
    font-size: 18px;
    color: #b8a0d8;
    text-shadow: 0 0 15px rgba(138, 43, 226, 0.3);
    letter-spacing: 1px;
}

/* Легенда */
.legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #aaa;
    font-size: 13px;
}

.legend-symbol {
    font-size: 18px;
    line-height: 1;
}

.legend-symbol.symbol-ok {
    color: #4caf50;
}

.legend-symbol.symbol-no {
    color: #ff4444;
}

.legend-symbol.symbol-gold {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
}

/* Адаптация */
@media (max-width: 768px) {
    .week-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .week-header h1 {
        font-size: 1.2em;
        text-align: center;
    }

    .tabs {
        justify-content: center;
    }

    .tab-btn {
        font-size: 13px;
        padding: 8px 16px;
    }

    .week-table {
        font-size: 12px;
        min-width: 600px;
    }

    .week-table th,
    .week-table td {
        padding: 8px 6px;
    }

    .week-table .col-nick {
        font-size: 12px;
        min-width: 80px;
        padding-left: 10px;
    }

    .week-table .col-status {
        font-size: 16px;
        min-width: 35px;
    }

    .week-table .col-tower {
        font-size: 15px;
        min-width: 35px;
    }

    .kvm-row {
        flex-direction: column;
        gap: 10px;
    }

    .kvm-item {
        justify-content: space-between;
    }

    .kvm-item input {
        width: 60%;
    }

    .otherworld-title {
        font-size: 20px;
    }
    
    .otherworld-info {
        font-size: 14px;
    }
    
    .kvm-total {
        font-size: 14px;
    }
    
    .kvm-total strong {
        font-size: 17px;
    }

    .legend {
        gap: 15px;
        font-size: 12px;
    }

    .legend-symbol {
        font-size: 15px;
    }

    .week-table .group-header .group-controls {
        display: flex;
        align-items: center;
        gap: 6px;
        float: none;
        margin-top: 5px;
        justify-content: flex-end;
    }

    .week-table .group-header .group-controls .add-input {
        width: 100px;
        font-size: 11px;
        padding: 3px 8px;
    }

    .week-table .group-header .group-controls .add-btn {
        font-size: 11px;
        padding: 3px 10px;
    }

    .week-table .group-header td {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 8px 10px;
    }

    .week-table .group-header .group-name {
        padding-left: 0;
    }
}

/* Колонка ДПС в башне */
.week-table .col-dps {
    text-align: right;
    padding-right: 15px;
    font-weight: bold;
    color: #ffd700;
    font-size: 14px;
    min-width: 80px;
    white-space: nowrap;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .week-table .col-dps {
        font-size: 12px;
        min-width: 60px;
        padding-right: 8px;
    }
}

/* ===== КНОПКИ ===== */
.week-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.controls-left,
.controls-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.save-btn {
    border: none;
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.save-btn:hover {
    opacity: 0.85;
}

.save-json {
    background: #4caf50;
    color: white;
}

.save-txt {
    background: #ff9800;
    color: white;
}

.save-reset {
    background: #f44336;
    color: white;
}

.save-stats {
    background: #9c27b0;
    color: white;
}

/* ===== ИТОГИ БАШНИ ===== */
/* Исправляем colspan для строки итогов в башне */
.week-table .total-row .col-tower {
    text-align: center;
    font-size: 16px;
    color: #ffd700;
    font-weight: bold;
}

/* ===== АДАПТАЦИЯ ===== */
@media (max-width: 768px) {
    .week-controls {
        justify-content: center;
        gap: 6px;
    }
    
    .controls-left,
    .controls-right {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .save-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}