/* Statistics Cards - Dedicated Styling */

/* Main Statistics Card Container */
.stats-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 2.5rem;
    margin: 2.5rem 0;
    box-shadow: 0 8px 32px rgba(14, 16, 50, 0.12);
    border: 1px solid rgba(52, 184, 195, 0.1);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--cta-color) 100%);
}

/* Header Section */
.stats-header {
    text-align: center;
    margin-bottom: 2rem;
}

.stats-header h3 {
    color: var(--dark-accent);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.stats-header h3 i {
    color: var(--accent-color);
    font-size: 1.6rem;
}

.stats-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0;
}

/* Main Stats Grid - Custom layout for uniform appearance */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* First card (Students Registered) spans full width */
.stats-grid .stat-item:first-child {
    grid-column: 1 / -1;
}

/* Second card takes left column of second row */
.stats-grid .stat-item:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
}

/* Third card takes right column of second row */
.stats-grid .stat-item:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

/* Individual Stat Items with Gradient Top Border */
.stat-item {
    display: flex;
    align-items: center;
    justify-content: center; /* Center content horizontally */
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    background: var(--cta-color); /* Orange background */
    color: var(--dark-accent);
    overflow: hidden;
}

/* Gradient Top Border Effect */
.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--cta-color) 0%,           /* Orange */
        var(--highlight-color) 25%,    /* Tea-rose-red */
        var(--accent-color) 50%,       /* Teal */
        var(--primary-color) 75%,      /* Deep blue */
        var(--secondary-color) 100%    /* Space-cadet */
    );
    border-radius: 12px 12px 0 0;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Card Color Schemes */
.stat-item.primary {
    background: var(--cta-color); /* Orange */
    color: var(--dark-accent);
}

.stat-item.accent {
    background: var(--accent-color); /* Teal */
    color: white;
}

.stat-item.cta {
    background: var(--accent-color); /* Teal */
    color: white;
}

.stat-item.secondary {
    background: var(--primary-color); /* Dark Blue */
    color: white;
}

.highlight-card.dark-blue {
    background: var(--primary-color); /* Dark Blue */
    color: white;
}

/* Stat Icon */
.stat-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.stat-icon i {
    font-size: 1.5rem;
}

/* Stat Content - Centered text on desktop */
.stat-content {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
    line-height: 1.2;
}

.stat-description {
    font-size: 0.8rem;
    opacity: 0.7;
    font-weight: 400;
    line-height: 1.3;
    margin-top: 0.25rem;
}

/* Highlights Section - Force 2x2 layout for better balance */
.stats-highlights {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Individual Highlight Cards with Gradient Top Border */
.highlight-card {
    display: flex;
    align-items: center;
    justify-content: center; /* Center content horizontally */
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    background: var(--accent-color); /* Teal background */
    color: white;
    overflow: hidden;
}

/* Gradient Top Border Effect - Reverse flow */
.highlight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--secondary-color) 0%,        /* Space-cadet */
        var(--primary-color) 25%,         /* Deep blue */
        var(--accent-color) 50%,          /* Teal */
        var(--highlight-color) 75%,       /* Tea-rose-red */
        var(--cta-color) 100%             /* Orange */
    );
    border-radius: 12px 12px 0 0;
}

.highlight-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Highlight Icon - Same as Stat Icon */
.highlight-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.highlight-icon i {
    font-size: 1.5rem;
}

/* Highlight Content - Centered text on desktop */
.highlight-card .stat-content {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.highlight-card .stat-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
    color: white; /* Ensure white text on teal background */
}

.highlight-card .stat-label {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
    line-height: 1.2;
    color: white; /* Ensure white text on teal background */
}

.highlight-card .stat-description {
    font-size: 0.8rem;
    opacity: 0.7;
    font-weight: 400;
    line-height: 1.3;
    margin-top: 0.25rem;
    color: white; /* Ensure white text on teal background */
}

/* Footer Section */
.stats-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(14, 16, 50, 0.1);
}

.stats-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.stats-footer i {
    color: var(--accent-color);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .stats-card {
        padding: 1.5rem;
        margin: 2rem 0;
    }
    
    .stats-header h3 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Reset desktop grid positioning for mobile - single column */
    .stats-grid .stat-item:first-child,
    .stats-grid .stat-item:nth-child(2),
    .stats-grid .stat-item:nth-child(3) {
        grid-column: 1;
        grid-row: auto;
    }
    
    .stat-item, .highlight-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .stat-icon, .highlight-icon {
        width: 40px;
        height: 40px;
        align-self: center; /* Center the icon vertically */
    }
    
    .stat-icon i, .highlight-icon i {
        font-size: 1.2rem;
    }
    
    .stat-number, .highlight-card .stat-number {
        font-size: 1.4rem;
    }
    
    .stat-description, .highlight-card .stat-description {
        font-size: 0.75rem;
    }
    
    .stats-highlights {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 0;
    }
    
    .stats-footer p {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-item, .highlight-card {
        flex-direction: row;
        text-align: left;
    }
    
    .stat-content, .highlight-card .stat-content {
        text-align: left; /* Override center alignment on mobile */
    }
    
    .stats-highlights {
        grid-template-columns: 1fr;
    }
    
    .stat-icon, .highlight-icon {
        align-self: flex-start;
    }
}
