/* =========================================
   Typing Test Dashboard - Matching wptt-dashboard.php1.txt Style
   ========================================= */

/* Main Container */
.wptt-gauge-container {
    padding: 30px 20px;
    border-radius: 12px;
    margin: 20px 0;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: #333;
}

.wptt-gauge-container h3 {
    color: #444;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    font-weight: 600;
}

/* --- Top Section: Main Gauges --- */
.wptt-gauges-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
}

/* Main Gauge */
.wptt-main-gauge {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 10px;
}
.wptt-main-gauge canvas {
    width: 100% !important;
    height: 100% !important;
}
.wptt-gauge-value {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}
.wptt-gauge-label {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

/* Mini Gauges Container */
.wptt-mini-gauges {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.wptt-mini-gauge {
    position: relative;
    width: 110px;
    height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}
.wptt-mini-gauge canvas {
    width: 90px !important;
    height: 90px !important;
}
.wptt-mini-value {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
}
.wptt-mini-label {
    margin-top: 15px;
    font-size: 0.8rem;
    color: #777;
    font-weight: 600;
    text-transform: uppercase;
}

/* --- Breakdown Cards Section --- */
.wptt-results-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    text-align: left;
}

/* Individual Card Styling */
.wptt-breakdown-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
}

.wptt-breakdown-item:hover {
    border-color: #4361ee;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    background: #ffffff;
}

/* Left Side Text Content */
.wptt-breakdown-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wptt-breakdown-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wptt-breakdown-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.wptt-breakdown-subtext {
    font-size: 0.8rem;
    color: #888;
    font-weight: 500;
}

/* Right Side Chart */
.wptt-breakdown-chart {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}
.wptt-breakdown-chart canvas {
    width: 100% !important;
    height: 100% !important;
}
.wptt-breakdown-chart-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

/* Colored Borders/Accents */
.character-item { border-left: 4px solid #6366f1; }
.word-item      { border-left: 4px solid #10b981; }
.time-item      { border-left: 4px solid #f59e0b; }

/* Text Colors for Chart Values */
.wptt-chart-character { color: #6366f1; }
.wptt-chart-word      { color: #10b981; }
.wptt-chart-error     { color: #ef4444; }
.wptt-chart-time      { color: #f59e0b; }

/* Performance Indicators */
.wptt-performance-indicator {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 6px;
    text-transform: uppercase;
}
.wptt-performance-excellent { background: #e3f2fd; color: #1565c0; }
.wptt-performance-good      { background: #e3f2fd; color: #1565c0; }
.wptt-performance-average   { background: #fff8e1; color: #b45309; }
.wptt-performance-poor      { background: #fce4e4; color: #b91c1c; }

/* Buttons - Matching wptt-dashboard.php1.txt button styles */
.wptt-button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.wptt-restart-button, .wptt-dashboard-button {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 140px;
    justify-content: center;
}

.wptt-restart-button {
    background: #4361ee;
    color: white;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.2);
}

.wptt-dashboard-button {
    background: white;
    color: #333;
    border: 1px solid #e2e6ea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wptt-restart-button:hover {
    background: #304ffe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.wptt-dashboard-button:hover {
    background: #f8f9fa;
    border-color: #ccc;
    transform: translateY(-2px);
}

/* Additional Styles to Match wptt-dashboard.php1.txt */

/* Badge Styles */
.wptt-badge-item {
    background: #fff8e1;
    border: 1px solid #ffe082;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 11px;
}

.badge-icon {
    font-size: 20px;
    margin-bottom: 5px;
}

/* Table Styles */
.wptt-results-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.wptt-results-table th {
    text-align: left;
    padding: 12px;
    background: #f9fafb;
    color: #666;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.wptt-results-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    vertical-align: middle;
}

/* Card Styles */
.wptt-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
    margin-bottom: 25px;
}

.wptt-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    color: #444;
}

/* Stat Card Styles */
.wptt-stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.wptt-stat-card .icon {
    font-size: 32px;
    background: #f0f4ff;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.wptt-stat-card h3 {
    margin: 0;
    color: #888;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 600;
}

.wptt-stat-card p {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

/* Leaderboard Styles */
.wptt-leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wptt-leaderboard-list li {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.wptt-leaderboard-list li:last-child {
    border-bottom: none;
}

.rank-badge {
    width: 30px;
    height: 30px;
    background: #f0f4ff;
    color: #4361ee;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-right: 12px;
}

/* Test Library Styles */
.wptt-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.wptt-lang-group {
    background: #fdfdfd;
    border: 1px solid #eef0f2;
    border-radius: 10px;
    padding: 15px;
}

.test-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: 0.2s;
}

.test-item:hover {
    border-color: #4361ee;
    transform: translateX(3px);
}

.btn-start {
    background: #06d6a0;
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.btn-start:hover {
    background: #05b083;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wptt-gauge-container {
        padding: 20px 15px;
    }
    
    .wptt-gauges-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }
    
    .wptt-main-gauge {
        width: 180px;
        height: 180px;
    }
    
    .wptt-gauge-value {
        font-size: 2rem;
    }
    
    .wptt-mini-gauge {
        width: 100px;
        height: 120px;
    }
    
    .wptt-mini-gauge canvas {
        width: 80px !important;
        height: 80px !important;
    }
    
    .wptt-mini-value {
        font-size: 1.1rem;
    }
    
    .wptt-results-breakdown {
        grid-template-columns: 1fr;
    }
    
    .wptt-button-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wptt-restart-button,
    .wptt-dashboard-button {
        width: 100%;
        min-width: auto;
    }
    
    .wptt-card {
        padding: 15px;
    }
    
    .wptt-stat-card {
        padding: 15px;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .wptt-library-grid {
        grid-template-columns: 1fr;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .wptt-gauge-container {
        padding: 15px 10px;
    }
    
    .wptt-mini-gauges {
        gap: 15px;
    }
    
    .wptt-mini-gauge {
        width: 90px;
        height: 110px;
    }
    
    .wptt-breakdown-item {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .wptt-breakdown-chart {
        align-self: flex-end;
    }
}