/**
 * Card Design System
 * @package SoiCauPro
 */

/* ========================================
   BASE CARD STYLES
   ======================================== */

/* Card cơ bản */
.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    position: relative;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Card Header */
.card-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header-gradient-red {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.card-header-gradient-blue {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.card-header-gradient-green {
    background: linear-gradient(135deg, #27ae60 0%, #16a085 100%);
}

.card-header-gradient-orange {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

/* Card Body */
.card-body {
    padding: 20px;
}

.card-body-compact {
    padding: 15px;
}

/* Card Footer */
.card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* ========================================
   CARD VARIATIONS
   ======================================== */

/* Card với ảnh */
.card-image {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

/* Card badge */
.card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    z-index: 10;
}

.card-badge-new {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    animation: pulse 2s infinite;
}

.card-badge-hot {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    animation: pulse 2s infinite;
}

/* Card với icon */
.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ========================================
   KẾT QUẢ XỔ SỐ CARDS
   ======================================== */

.result-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.result-card-header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #ffffff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-card-title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

.result-card-date {
    font-size: 14px;
    opacity: 0.9;
}

.result-card-body {
    padding: 20px;
    background: #fafafa;
}

.result-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.result-number {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    animation: bounceIn 0.5s ease;
}

.result-number-special {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    font-size: 22px;
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
}

/* ========================================
   SOI CẦU CARDS
   ======================================== */

.soicau-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.soicau-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.soicau-card-header {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.soicau-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="100" fill="white" opacity="0.1">🎲</text></svg>');
    background-size: 50px;
    opacity: 0.1;
}

.soicau-card-content {
    padding: 20px;
}

.soicau-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
}

.soicau-card-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #7f8c8d;
}

.soicau-card-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.soicau-card-excerpt {
    color: #5a6c7d;
    line-height: 1.6;
    margin-bottom: 15px;
}

.soicau-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

.soicau-card-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.soicau-card-link:hover {
    color: #2980b9;
    gap: 8px;
}

/* ========================================
   THỐNG KÊ CARDS
   ======================================== */

.stats-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.stats-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.stats-card-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 28px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.stats-card-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stats-card-label {
    font-size: 14px;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-card-trend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding: 5px 12px;
    background: #e8f8f5;
    color: #27ae60;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.stats-card-trend.down {
    background: #fdedec;
    color: #e74c3c;
}

/* ========================================
   WIDGET CARDS
   ======================================== */

.widget-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.widget-card-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    position: relative;
}

.widget-card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    width: 40px;
    height: 3px;
    background: #f39c12;
}

.widget-card-body {
    padding: 20px;
}

.widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-list-item {
    padding: 12px 0;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.widget-list-item:last-child {
    border-bottom: none;
}

.widget-list-item:hover {
    padding-left: 10px;
    background: #f8f9fa;
    margin: 0 -20px;
    padding-left: 30px;
    padding-right: 20px;
}

/* ========================================
   QUICK ACTION CARDS
   ======================================== */

.action-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    color: #ffffff;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.action-card-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.action-card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.action-card-description {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.5;
}

/* ========================================
   GRID LAYOUTS
   ======================================== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card-grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.card-grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.card-grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .card {
        border-radius: 8px;
        margin-bottom: 15px;
    }
    
    .card-header,
    .card-footer {
        padding: 12px 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-card-value {
        font-size: 28px;
    }
    
    .result-number {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .result-number-special {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .soicau-card-header {
        height: 150px;
    }
    
    .action-card {
        padding: 20px;
    }
    
    .action-card-icon {
        font-size: 36px;
    }
    
    .widget-list-item:hover {
        margin: 0 -15px;
        padding-left: 25px;
        padding-right: 15px;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.card-shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-shadow-md {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-shadow-lg {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-shadow-xl {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.card-border-top-primary {
    border-top: 4px solid #667eea;
}

.card-border-top-success {
    border-top: 4px solid #27ae60;
}

.card-border-top-warning {
    border-top: 4px solid #f39c12;
}

.card-border-top-danger {
    border-top: 4px solid #e74c3c;
}