/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f4f7fc;
    color: #333;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    color: #002366;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    height: 50px;
    margin-right: 20px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
}

.header-right {
    text-align: right;
}

.header-right p {
    margin: 0;
    font-size: 1.1rem;
}

.auto-refresh-info {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 5px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 35, 102, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #002366;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Call Logs Content */
#callLogsContent {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

.user-card {
    background-color: #34495e;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.goal-progress-container {
    background-color: #2c3e50;
    border-radius: 5px;
    height: 10px;
    margin-top: 15px;
    width: 100%;
    overflow: hidden;
}

.goal-progress-bar {
    height: 100%;
    background-color: #007bff; /* Blue for in-progress */
    border-radius: 5px;
    transition: width 0.4s ease-in-out;
}

.goal-progress-bar.goal-met {
    background-color: #28a745; /* Green for completed */
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.user-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #002366;
}

.call-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #eee;
}

.stat-item.outbound {
    border-left: 4px solid #007bff;
}

.stat-item.inbound {
    border-left: 4px solid #28a745;
}

.stat-item.total {
    border-left: 4px solid #6f42c1;
}

.stat-item-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    margin-top: 5px;
}

.stat-item-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

/* Leaderboard Styles */
.leaderboard-container {
    margin-bottom: 20px;
}

.leaderboard-title {
    font-size: 1.8em;
    font-weight: bold;
    color: #ffc107;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    background-color: #3e4a61;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.4em;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.leaderboard-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.leaderboard-item .rank {
    font-weight: bold;
    margin-right: 20px;
    width: 40px;
    flex-shrink: 0;
}

.leaderboard-item .name {
    flex-grow: 1;
    text-align: left;
}

.leaderboard-item .time {
    font-family: 'Roboto Mono', monospace;
    font-weight: bold;
}

/* Top 3 Rank Colors */
.leaderboard-item.rank-1 {
    background-color: #d4af37; /* Gold */
    color: #2c3e50;
}

.leaderboard-item.rank-2 {
    background-color: #c0c0c0; /* Silver */
    color: #2c3e50;
}

.leaderboard-item.rank-3 {
    background-color: #cd7f32; /* Bronze */
    color: #2c3e50;
}

/* Loading and Error States */
.loading, .no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.last-updated {
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    margin-top: 15px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .header-left {
        margin-bottom: 15px;
        justify-content: center;
    }
    
    .header-right {
        text-align: center;
    }
    
    .call-stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .call-stats {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
}
