/* assets/css/frontend.css */
/* Main Container */
.tsm-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 900px;
    margin: 20px auto;
    position: relative;
}

/* Auth Styles */
.tsm-auth-container {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tsm-auth-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.tsm-auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tsm-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
}

.tsm-tab.active {
    color: #2575fc;
    border-bottom-color: #2575fc;
    font-weight: bold;
}

.tsm-auth-form {
    display: none;
}

.tsm-auth-form.active {
    display: block;
}

.tsm-form-group {
    margin-bottom: 15px;
}

.tsm-form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.tsm-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tsm-btn-primary {
    background: #2575fc;
    color: white;
    width: 100%;
}

.tsm-btn-primary:hover {
    background: #1a68e0;
    transform: translateY(-2px);
}

/* User Info */
.tsm-user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tsm-user-info span {
    font-weight: bold;
    color: #2575fc;
    font-size: 18px;
}

.tsm-logout-btn {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
}

.tsm-logout-btn:hover {
    background: #c82333;
}

/* Dashboard Menu */
.tsm-menu-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #2575fc;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 100;
}

.tsm-dashboard-menu {
    position: absolute;
    top: 70px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    min-width: 250px;
    display: none;
    z-index: 99;
}

.tsm-menu-header {
    background: linear-gradient(135deg, #2575fc, #6a11cb);
    color: white;
    padding: 15px;
    border-radius: 10px 10px 0 0;
}

.tsm-menu-items {
    padding: 10px 0;
}

.tsm-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.tsm-menu-item:hover {
    background: #f8f9fa;
}

.tsm-menu-item span {
    margin-right: 10px;
}

.tsm-menu-divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}

/* Settings */
.tsm-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.tsm-setting-group {
    display: flex;
    flex-direction: column;
}

.tsm-setting-group label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #495057;
}

.tsm-setting-group select {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
}

/* Stats */
.tsm-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.tsm-stat-box {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.tsm-stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.tsm-stat-value {
    font-size: 24px;
    font-weight: bold;
}

.tsm-time { background: #d1ecf1; border: 2px solid #0dcaf0; }
.tsm-wpm { background: #d4edda; border: 2px solid #198754; }
.tsm-cpm { background: #fff3cd; border: 2px solid #ffc107; }
.tsm-accuracy { background: #f8d7da; border: 2px solid #dc3545; }

/* Progress Bar */
.tsm-progress {
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}

.tsm-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2575fc, #6a11cb);
    width: 100%;
    transition: width 1s linear;
}

/* Text Container */
.tsm-text-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    min-height: 150px;
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid #dee2e6;
}

.tsm-text-display {
    font-size: 18px;
    line-height: 1.6;
    word-break: break-word;
}

/* Input Box */
.tsm-input-box {
    width: 100%;
    height: 120px;
    padding: 15px;
    font-size: 16px;
    border-radius: 8px;
    border: 2px solid #2575fc;
    margin-bottom: 20px;
    resize: none;
    font-family: 'Courier New', monospace;
}

/* Controls */
.tsm-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.tsm-btn-reset { background: #dc3545; color: white; }
.tsm-btn-prev { background: #6c757d; color: white; }
.tsm-btn-next { background: #198754; color: white; }
.tsm-btn-history { background: #6f42c1; color: white; }

.tsm-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Performance */
.tsm-performance {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    display: none;
    text-align: center;
    font-weight: bold;
}

.tsm-performance.fair { background: #fff3cd; color: #856404; }
.tsm-performance.good { background: #d1ecf1; color: #0c5460; }
.tsm-performance.very-good { background: #d4edda; color: #155724; }

/* History */
.tsm-history-container {
    display: none;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.tsm-history-list table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.tsm-history-list th {
    background: #2575fc;
    color: white;
    padding: 12px;
    text-align: left;
}

.tsm-history-list td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

/* Typing Highlights */
.tsm-correct { color: #198754; }
.tsm-incorrect { color: #dc3545; text-decoration: underline; }
.tsm-current { background: #ffeb3b; padding: 2px 4px; border-radius: 4px; }

/* Responsive */
@media (max-width: 768px) {
    .tsm-container {
        padding: 15px;
        margin: 10px;
    }
    
    .tsm-settings {
        grid-template-columns: 1fr;
    }
    
    .tsm-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tsm-controls {
        grid-template-columns: 1fr;
    }
    
    .tsm-dashboard-menu {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        border-radius: 0;
        min-width: auto;
    }
    
    .tsm-text-container {
        min-height: 120px;
        max-height: 150px;
    }
    
    .tsm-input-box {
        height: 100px;
    }
}

@media (max-width: 480px) {
    .tsm-stats {
        grid-template-columns: 1fr;
    }
    
    .tsm-stat-box {
        padding: 15px;
    }
    
    .tsm-auth-box {
        padding: 20px;
    }
}