/**
 * Swap History Page Styles
 */

/* ========================================
   Statistics Cards
   ======================================== */

.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    margin-bottom: 8px;
}

.stat-card {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:active {
    transform: scale(0.97);
}

.stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--tg-theme-text-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    font-weight: 500;
}

/* ========================================
   History Container
   ======================================== */

.history-container {
    padding: 0 16px 16px;
}

.history-card {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.history-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   History Card Header
   ======================================== */

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(var(--tg-theme-hint-color-rgb, 128, 128, 128), 0.2);
}

.partner-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.partner-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.partner-details strong {
    font-size: 16px;
    color: var(--tg-theme-text-color);
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(var(--tg-theme-button-color-rgb, 62, 144, 234), 0.15);
    color: var(--tg-theme-button-color);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.completion-date {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    text-align: right;
}

/* ========================================
   Swap Details
   ======================================== */

.swap-details {
    margin-bottom: 12px;
}

.swap-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--tg-theme-text-color);
}

.shift-time {
    color: var(--tg-theme-hint-color);
    font-size: 13px;
}

/* ========================================
   History Footer
   ======================================== */

.history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(var(--tg-theme-hint-color-rgb, 128, 128, 128), 0.2);
}

.btn-rate {
    padding: 10px 20px;
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-rate:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--tg-theme-button-color-rgb, 62, 144, 234), 0.3);
}

.btn-rate:active {
    transform: translateY(0);
}

.rating-display {
    font-size: 14px;
    color: var(--tg-theme-text-color);
}

.partner-rating {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
}

/* ========================================
   Rating Modal
   ======================================== */

.rating-modal .modal-body {
    text-align: center;
    padding: 24px 20px;
}

.rating-label {
    font-size: 16px;
    color: var(--tg-theme-text-color);
    margin-bottom: 24px;
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.star-btn {
    background: transparent;
    border: none;
    font-size: 40px;
    cursor: pointer;
    transition: all 0.2s;
    filter: grayscale(100%);
    opacity: 0.4;
}

.star-btn:hover {
    transform: scale(1.2);
    opacity: 0.6;
}

.star-btn.selected {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

.star-btn:active {
    transform: scale(1);
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    max-width: 300px;
}

/* ========================================
   Loading
   ======================================== */

.loading-spinner {
    text-align: center;
    padding: 40px 20px;
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #f44336;
    font-size: 14px;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 360px) {
    .stats-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 12px;
    }
    
    .stat-card {
        padding: 12px 8px;
    }
    
    .stat-icon {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 10px;
    }
}

