/* ===== ОБЩИЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0f0f1a;
    color: #e8e8e8;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    padding: 30px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== ШАПКА СТРАНИЦЫ ===== */
.page-header {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 30px;
    border: 1px solid rgba(74, 144, 217, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.page-header .left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-header .icon-wrapper {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.2), rgba(74, 144, 217, 0.05));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(74, 144, 217, 0.2);
}

.page-header .icon-wrapper i {
    font-size: 22px;
    color: #4a90d9;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #e8e8e8;
    letter-spacing: -0.3px;
}

.page-header .subtitle {
    color: #8a9ab0;
    font-size: 14px;
    margin-top: 2px;
}

.page-header .actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== КНОПКИ ===== */
.btn-primary {
    background: linear-gradient(135deg, #4a90d9, #357abd);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 217, 0.35);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-outline {
    background: transparent;
    color: #4a90d9;
    border: 1px solid #4a90d9;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-outline:hover {
    background: rgba(74, 144, 217, 0.1);
    border-color: #4a90d9;
}

.btn-expand {
    background: transparent;
    color: #4a90d9;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-expand:hover {
    background: rgba(74, 144, 217, 0.1);
    color: #6aafe9;
}

.btn-expand i {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.btn-expand.expanded i {
    transform: rotate(180deg);
}

/* ===== КАРТОЧКА ВЕРСИИ ===== */
.version-card {
    background: #16213e;
    border-radius: 14px;
    padding: 24px 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    transition: all 0.3s ease;
}

.version-card:hover {
    border-color: rgba(74, 144, 217, 0.2);
}

.version-card .left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.version-card .label {
    color: #8a9ab0;
    font-size: 13px;
    font-weight: 500;
}

.version-card .version-number {
    font-size: 26px;
    font-weight: 800;
    color: #e8e8e8;
    letter-spacing: -0.5px;
}

.version-card .badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.badge.success {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.25);
}

.badge.warning {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.25);
}

.badge i {
    font-size: 14px;
}

/* ===== СТАТИСТИКА ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: #16213e;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(74, 144, 217, 0.2);
    box-shadow: 0 4px 20px rgba(74, 144, 217, 0.08);
}

.stat-card .number {
    font-size: 32px;
    font-weight: 800;
    color: #4a90d9;
    letter-spacing: -0.5px;
}

.stat-card .label {
    color: #8a9ab0;
    font-size: 13px;
    font-weight: 500;
    margin-top: 4px;
}

/* ===== ТАБЛИЦА ИСТОРИИ ===== */
.history-section {
    background: #16213e;
    border-radius: 14px;
    padding: 26px 28px;
    border: 1px solid rgba(255,255,255,0.06);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.history-header .title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-header .title i {
    color: #4a90d9;
    font-size: 18px;
}

.history-header .title h3 {
    font-size: 18px;
    font-weight: 600;
    color: #e8e8e8;
}

.history-header .info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.history-header .info .text {
    color: #8a9ab0;
    font-size: 13px;
}

.history-header .info .text .highlight {
    color: #4a90d9;
    font-weight: 600;
}

/* ===== ТАБЛИЦА ===== */
.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
}

.update-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    min-width: 700px;
}

.update-table thead {
    background: rgba(74, 144, 217, 0.08);
}

.update-table thead th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    color: #8a9ab0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.update-table thead th:first-child {
    border-radius: 12px 0 0 0;
}

.update-table thead th:last-child {
    border-radius: 0 12px 0 0;
}

.update-table tbody tr {
    transition: all 0.2s ease;
    cursor: default;
}

.update-table tbody tr:hover {
    background: rgba(74, 144, 217, 0.04);
}

.update-table tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #d0d0d0;
    vertical-align: middle;
}

.update-table tbody tr:last-child td {
    border-bottom: none;
}

.update-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 12px;
}

.update-table tbody tr:last-child td:last-child {
    border-radius: 0 0 12px 0;
}

/* Колонка Версия */
.update-table .col-version {
    font-weight: 700;
    color: #e8e8e8;
    font-size: 15px;
    white-space: nowrap;
}

/* Колонка Дата */
.update-table .col-date {
    color: #8a9ab0;
    font-size: 13px;
    white-space: nowrap;
}

.update-table .col-date i {
    margin-right: 6px;
    font-size: 12px;
}

/* Колонка Тип */
.update-table .col-type {
    white-space: nowrap;
}

.update-table .type-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.type-tag.major {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
    border: 1px solid rgba(155, 89, 182, 0.2);
}

.type-tag.minor {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.type-tag.patch {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.2);
}

.type-tag.rollback {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.type-tag i {
    font-size: 11px;
}

/* Колонка Действие */
.update-table .col-action {
    white-space: nowrap;
}

.update-table .action-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.action-badge.install {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
}

.action-badge.rollback {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.action-badge.update {
    background: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
}

.action-badge i {
    font-size: 11px;
}

/* Колонка Описание */
.update-table .col-desc {
    color: #b8c8d8;
    font-size: 13px;
    line-height: 1.6;
    max-width: 350px;
    min-width: 200px;
}

.update-table .col-desc .desc-content {
    position: relative;
}

.update-table .col-desc .desc-text {
    display: block;
}

.update-table .col-desc .desc-text .line {
    display: block;
    padding: 1px 0;
    padding-left: 16px;
    position: relative;
}

.update-table .col-desc .desc-text .line::before {
    content: '▸';
    color: #4a90d9;
    position: absolute;
    left: 0;
    font-weight: 700;
    font-size: 12px;
}

.update-table .col-desc .desc-text.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 3.2em;
}

.update-table .col-desc .desc-text.full {
    display: block;
    max-height: none;
    -webkit-line-clamp: unset;
}

.update-table .col-desc .desc-actions {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.update-table .col-desc .desc-actions .line-count {
    color: #6a7a8a;
    font-size: 11px;
}

/* ===== ПУСТОЕ СОСТОЯНИЕ ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #8a9ab0;
}

.empty-state i {
    font-size: 48px;
    color: #4a90d9;
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #1a1a2e;
    border-radius: 18px;
    padding: 32px;
    max-width: 480px;
    width: 100%;
    border: 1px solid rgba(74, 144, 217, 0.15);
    animation: modalSlide 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

@keyframes modalSlide {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #e8e8e8;
}

.modal-close {
    background: none;
    border: none;
    color: #8a9ab0;
    font-size: 26px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0 4px;
}

.modal-close:hover {
    color: #e8e8e8;
    transform: rotate(90deg);
}

.modal-body {
    color: #c0c0c0;
    line-height: 1.6;
}

.modal-body .loading {
    text-align: center;
    padding: 20px 0;
}

.modal-body .loading .spinner-lg {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(74, 144, 217, 0.2);
    border-radius: 50%;
    border-top-color: #4a90d9;
    animation: spin 1s linear infinite;
}

.modal-body .loading p {
    margin-top: 16px;
    color: #8a9ab0;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 14px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    z-index: 2000;
    animation: toastSlide 0.4s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    max-width: 400px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

@keyframes toastSlide {
    from {
        transform: translateX(60px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success { background: #27ae60; }
.toast.error { background: #e74c3c; }
.toast.info { background: #4a90d9; }
.toast.warning { background: #f39c12; }

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .update-table .col-desc {
        max-width: 250px;
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    body { padding: 16px; }
    
    .page-header {
        padding: 20px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-header .left {
        flex-direction: column;
        text-align: center;
    }
    
    .page-header .actions {
        justify-content: center;
    }
    
    .version-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .version-card .left {
        justify-content: center;
    }
    
    .history-section {
        padding: 18px;
    }
    
    .history-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modal {
        padding: 24px;
        margin: 16px;
    }
    
    .update-table {
        font-size: 13px;
        min-width: 600px;
    }
    
    .update-table tbody td,
    .update-table thead th {
        padding: 10px 14px;
    }
    
    .update-table .col-desc {
        max-width: 180px;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-card .number {
        font-size: 24px;
    }
    
    .version-card .version-number {
        font-size: 22px;
    }
    
    .update-table {
        min-width: 480px;
        font-size: 12px;
    }
    
    .update-table tbody td,
    .update-table thead th {
        padding: 8px 10px;
    }
    
    .update-table .col-desc {
        max-width: 120px;
        min-width: 80px;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0f0f1a;
}

::-webkit-scrollbar-thumb {
    background: #4a90d9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #357abd;
}
