/* ===========================
   USER TYPING HISTORY STYLES
=========================== */

.typing-user-history-wrapper {
    max-width: 100%;
    margin: 30px auto;
    padding: 0 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.typing-user-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e8eef7;
}

.typing-user-history-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 26px;
    font-weight: 600;
}

.typing-user-total {
    background: #e8f4f8;
    color: #0c5460;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.typing-user-total strong {
    color: #0c5460;
    font-weight: 700;
}

/* Table Wrapper */
.typing-user-table-wrapper {
    overflow-x: auto;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.typing-user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.typing-user-table thead {
    background: linear-gradient(to right, #f8f9fa, #f1f3f5);
    border-bottom: 2px solid #dee2e6;
}

.typing-user-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.typing-user-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.15s ease;
}

.typing-user-table tbody tr:hover {
    background-color: #f8f9fa;
}

.typing-user-table td {
    padding: 12px;
    color: #555;
    vertical-align: middle;
}

/* Column Widths */
.col-user {
    width: 120px;
    font-weight: 600;
    color: #2c3e50;
}

.col-date {
    width: 130px;
}

.col-language {
    width: 100px;
}

.col-mode {
    width: 90px;
}

.col-time {
    width: 70px;
}

.col-wpm {
    width: 80px;
    font-weight: 600;
    color: #2980b9;
}

.col-accuracy {
    width: 120px;
}

.col-details {
    width: 100px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-language-english {
    background-color: #d1ecf1;
    color: #0c5460;
}

.badge-language-hindi {
    background-color: #fff3cd;
    color: #856404;
}

.badge-mode-practice {
    background-color: #d4edda;
    color: #155724;
}

.badge-mode-exam {
    background-color: #f8d7da;
    color: #721c24;
}

/* Accuracy Bar */
.accuracy-bar {
    display: inline-block;
    width: 60px;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-right: 8px;
    vertical-align: middle;
}

.accuracy-fill {
    display: block;
    height: 100%;
    background: linear-gradient(to right, #27ae60, #2ecc71);
    border-radius: 3px;
}

/* Details */
.typing-details {
    cursor: pointer;
}

.typing-details summary {
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 4px;
    user-select: none;
    font-weight: 500;
    color: #555;
    transition: all 0.2s ease;
    display: inline-block;
    width: 50px;
    text-align: center;
}

.typing-details summary:hover {
    background: #e0e0e0;
}

.details-box {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 12px;
    min-width: 200px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
    padding: 4px 0;
}

.detail-row span {
    color: #666;
}

.detail-row strong {
    color: #2c3e50;
    font-weight: 600;
}

.text-success {
    color: #27ae60;
}

.text-error {
    color: #e74c3c;
}

/* Pagination */
.typing-user-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.typing-page-link {
    display: inline-block;
    padding: 8px 12px;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 13px;
}

.typing-page-link:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-2px);
}

.typing-page-link.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    cursor: default;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.typing-page-info {
    margin-left: 12px;
    color: #666;
    font-size: 12px;
    font-weight: 500;
}

/* ===========================
   RESPONSIVE DESIGN
=========================== */

@media (max-width: 768px) {
    .typing-user-history-wrapper {
        margin: 20px auto;
        padding: 0 10px;
    }

    .typing-user-history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .typing-user-history-header h2 {
        font-size: 22px;
    }

    .typing-user-table {
        font-size: 12px;
    }

    .typing-user-table th,
    .typing-user-table td {
        padding: 8px 6px;
    }

    .col-date {
        width: 110px;
        font-size: 11px;
    }

    .col-user {
        width: 100px;
        font-size: 12px;
    }

    .col-language,
    .col-mode {
        width: 80px;
    }

    .col-time {
        width: 60px;
    }

    .col-wpm {
        width: 70px;
    }

    .col-accuracy {
        width: 100px;
        font-size: 11px;
    }

    .col-details {
        width: 90px;
    }

    .badge {
        font-size: 9px;
        padding: 3px 6px;
    }

    .accuracy-bar {
        width: 50px;
        height: 5px;
        margin-right: 4px;
    }

    .typing-page-link {
        padding: 6px 10px;
        font-size: 12px;
    }

    .typing-page-info {
        font-size: 11px;
        margin-left: 8px;
    }

    .details-box {
        font-size: 11px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .typing-user-history-wrapper {
        margin: 15px auto;
        padding: 0 8px;
    }

    .typing-user-table-wrapper {
        border: none;
        border-radius: 0;
        margin: -8px -8px 20px -8px;
    }

    .typing-user-table {
        font-size: 11px;
    }

    .typing-user-table th,
    .typing-user-table td {
        padding: 6px 4px;
    }

    .col-date {
        width: 90px;
        font-size: 10px;
    }

    .col-user {
        width: 80px;
        font-size: 10px;
    }

    .col-language,
    .col-mode,
    .col-time {
        width: 60px;
    }

    .col-wpm {
        width: 55px;
    }

    .col-accuracy {
        width: 80px;
        font-size: 10px;
    }

    .col-details {
        width: 70px;
    }

    .badge {
        font-size: 8px;
        padding: 2px 4px;
    }

    .accuracy-bar {
        width: 40px;
        height: 4px;
    }

    .accuracy-bar+span {
        font-size: 10px;
    }

    .typing-page-link {
        padding: 5px 8px;
        font-size: 11px;
    }

    .typing-page-info {
        font-size: 10px;
        margin-left: 5px;
    }

    .typing-user-history-header {
        gap: 8px;
    }

    .typing-user-history-header h2 {
        font-size: 18px;
    }

    .typing-user-total {
        font-size: 12px;
        padding: 6px 10px;
    }

    .details-box {
        font-size: 10px;
        padding: 8px;
        min-width: 160px;
    }

    .detail-row {
        margin: 4px 0;
        padding: 2px 0;
    }
}