/* TypingMaster Pro - Premium UI Styles */

/* Modal System */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 1999;
    animation: fadeIn 0.3s ease;
}

.modal-backdrop.active {
    display: block;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    max-height: 90vh;
    overflow-y: auto;
    display: none;
    animation: modalSlideIn 0.3s ease;
}

.modal.active {
    display: block;
}

.modal-small {
    width: 90%;
    max-width: 400px;
}

.modal-medium {
    width: 90%;
    max-width: 600px;
}

.modal-large {
    width: 90%;
    max-width: 900px;
}

@keyframes modalSlideIn {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0066ff;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 102, 255, 0.1);
    color: #0066ff;
}

.modal-body {
    padding: 25px;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.modal-footer .btn {
    margin: 0;
}

/* Modal Types */
.modal-success {
    border-left: 4px solid #00d084;
}

.modal-error {
    border-left: 4px solid #ff3333;
}

.modal-warning {
    border-left: 4px solid #ffa500;
}

.modal-info {
    border-left: 4px solid #0066ff;
}

/* Game Container */
.game-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a2e 100%);
    z-index: 2001;
    display: none;
    flex-direction: column;
    animation: slideInUp 0.3s ease;
}

.game-container.active {
    display: flex;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #0066ff 0%, #00b4d8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.game-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.game-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

.game-timer {
    font-size: 36px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    text-align: right;
}

.game-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow-y: auto;
}

.game-word-sprint,
.game-accuracy-race,
.game-rapid-fire {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 100%;
}

.current-word {
    font-size: 48px;
    font-weight: 700;
    color: #0066ff;
    text-align: center;
    margin-bottom: 30px;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

.word-input,
.accuracy-input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 25px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.word-input:focus,
.accuracy-input:focus {
    outline: none;
    border-color: #0066ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 25px;
}

.game-stats .stat {
    text-align: center;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 8px;
}

.game-stats .stat span:first-child {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.game-stats .stat span:last-child {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #0066ff;
}

/* User Profile Panel */
.user-profile-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 1000;
    display: none;
    animation: slideInRight 0.3s ease;
}

.user-profile-panel.active {
    display: block;
}

@keyframes slideInRight {
    from {
        transform: translateX(320px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.user-info {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0066ff, #00b4d8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 10px;
}

.user-name {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.user-status {
    font-size: 12px;
    color: #666;
}

.user-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-item {
    background: #f0f0f0;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
}

.stat-item .label {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-item .value {
    font-size: 18px;
    font-weight: 700;
    color: #0066ff;
}

.user-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-actions .btn {
    font-size: 13px;
    padding: 10px 15px;
}

/* Streak Display */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

.streak-badge.active {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Achievement Display */
.achievements-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.achievement-icon {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.achievement-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.achievement-icon.locked {
    opacity: 0.4;
    filter: grayscale(100%);
}

.achievement-icon.unlocked {
    background: linear-gradient(135deg, #0066ff, #00b4d8);
    border-color: #0066ff;
}

.achievement-icon .date {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 8px;
    padding: 2px;
    text-align: center;
    border-radius: 0 0 8px 8px;
    display: none;
}

.achievement-icon:hover .date {
    display: block;
}

/* Goals Progress */
.goal-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #0066ff;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.goal-name {
    font-weight: 600;
    color: #333;
}

.goal-progress-pct {
    font-weight: 700;
    color: #0066ff;
}

.progress-bar-small {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-small-fill {
    height: 100%;
    background: linear-gradient(90deg, #0066ff, #00b4d8);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Premium Badge */
.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ffa500, #ff6b6b);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.premium-badge::before {
    content: '⭐';
}

/* Responsive */
@media (max-width: 768px) {
    .modal-small,
    .modal-medium,
    .modal-large {
        width: 95% !important;
        max-width: 95% !important;
    }

    .game-container {
        padding: 0;
    }

    .game-header {
        flex-direction: column;
        gap: 10px;
    }

    .game-controls {
        width: 100%;
        justify-content: space-between;
    }

    .game-content {
        padding: 20px;
    }

    .game-word-sprint,
    .game-accuracy-race,
    .game-rapid-fire {
        padding: 20px;
    }

    .current-word {
        font-size: 36px;
    }

    .user-profile-panel {
        width: calc(100% - 40px);
        right: 20px;
        max-width: 300px;
    }

    .game-stats {
        grid-template-columns: 1fr;
    }
}
