/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 100%;
    margin: 0;
    padding: 0 20px;
}

/* Global alignment utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-start {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.p-4 {
    padding: 1rem;
}

/* Header */
header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffd700;
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.1);
    border-bottom: 2px solid #ffd700;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 215, 0, 0.3); }
    to { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.5); }
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    color: #ffd700;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1a1a;
    border: 2px solid #ffd700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
    color: #ffd700;
    border: 2px solid #404040;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #404040 0%, #2d2d2d 100%);
}

.btn-success {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1a1a;
    border: 2px solid #ffd700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #8b0000 0%, #dc143c 100%);
    color: #ffd700;
    border: 2px solid #dc143c;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(220, 20, 60, 0.4);
}

/* Cards */
.card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 215, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 215, 0, 0.3);
}

.card h3 {
    color: #ffd700;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Grid */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* Difficulty sections */
.difficulty-section {
    margin: 2rem 0;
}

.difficulty-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.easy { color: #ffd700; }
.medium { color: #ffed4e; }
.hard { color: #ff6b6b; }

/* Passage cards */
.passage-card {
    border-left: 4px solid #ffd700;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.passage-card:hover {
    border-left-color: #ffed4e;
    background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
    transform: translateX(8px);
}

.passage-card h3 {
    color: #ffd700;
    margin-bottom: 0.5rem;
}

.passage-card p {
    color: #cccccc;
    font-size: 0.9rem;
}

/* Typing test interface - REMOVED - Using new Test Page Alignments section above */

/* Professional Test Page Layout */
.test-page-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    display: flex;
    flex-direction: column;
}

.test-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.2);
    margin: 1rem;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.test-controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shimmer 3s infinite;
}

.control-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-label {
    color: #ffd700;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.time-selector select {
    background: rgba(10, 10, 10, 0.8);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    min-width: 140px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.time-selector select:hover {
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(10, 10, 10, 0.9);
}

.timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.15);
    backdrop-filter: blur(5px);
    position: relative;
}

.timer {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffd700;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    animation: pulse 2s infinite;
    letter-spacing: 0.05em;
}

.timer-bar {
    width: 180px;
    height: 6px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.timer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #fbbf24);
    border-radius: 3px;
    transition: width 1s linear, background 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    position: relative;
}

.timer-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

.button-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-professional {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-professional::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-professional:hover::before {
    left: 100%;
}

.btn-professional:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn-success-professional {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-primary-professional {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.btn-secondary-professional {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

/* Professional Typing Container */
.typing-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 0 1rem 1rem;
    height: calc(100vh - 140px);
    width: calc(100% - 2rem);
    max-width: none;
}

.typing-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 215, 0, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 215, 0, 0.05);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.typing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.3), transparent);
}

.typing-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.typing-card-title {
    color: #ffd700;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.typing-card-icon {
    width: 24px;
    height: 24px;
    opacity: 0.6;
}

.passage-display {
    flex: 1;
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    padding: 1.25rem;
    font-size: 1.05rem;
    line-height: 1.1;
    color: #ffd700;
    font-family: 'Courier New', monospace;
    overflow-y: auto;
    word-wrap: break-word;
    position: relative;
}

.passage-display::-webkit-scrollbar {
    width: 6px;
}

.passage-display::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.passage-display::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
}

.typing-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.typing-textarea {
    flex: 1;
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    padding: 1.25rem;
    font-size: 1.05rem;
    line-height: 1.1;
    color: #ffd700;
    font-family: 'Courier New', monospace;
    resize: none;
    transition: all 0.3s ease;
    word-wrap: break-word;
    position: relative;
}

.typing-textarea:focus {
    outline: none;
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(10, 10, 10, 0.7);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.1);
}

/* VIP Professional Results Modal */
.results-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(15px);
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.results-content {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 32px;
    padding: 3rem;
    max-width: 600px;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: hidden;
    box-shadow: 
        0 0 0 1px rgba(255, 215, 0, 0.1),
        0 25px 100px rgba(0, 0, 0, 0.8),
        0 50px 200px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    position: relative;
    animation: slideUp 0.4s ease-out;
    backdrop-filter: blur(10px);
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.results-content::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.3), rgba(255, 237, 78, 0.2), rgba(255, 215, 0, 0.3), rgba(255, 237, 78, 0.2));
    border-radius: 32px;
    z-index: -1;
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Hide scrollbar for webkit browsers */
.results-content::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for Firefox */
.results-content {
    scrollbar-width: none;
}

/* Hide scrollbar for IE and Edge */
.results-content {
    -ms-overflow-style: none;
}

.results-title {
    color: #ffd700;
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2.5rem;
    text-shadow: 
        0 0 30px rgba(255, 215, 0, 0.5),
        0 0 60px rgba(255, 215, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    position: relative;
}

.results-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
    animation: shimmer 2s infinite;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    position: relative;
}

.result-item {
    text-align: center;
    padding: 0.5rem;
    background: rgba(15, 15, 15, 0.7);
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.15), transparent);
    transition: left 0.6s ease;
}

.result-item:hover::before {
    left: 100%;
}

.result-item:hover {
    background: rgba(20, 20, 20, 0.9);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 10px 30px rgba(255, 215, 0, 0.2),
        0 0 0 1px rgba(255, 215, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.result-label {
    color: rgba(255, 215, 0, 0.7);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.result-value {
    color: #ffd700;
    font-weight: 800;
    font-size: 1.3rem;
    font-family: 'Courier New', monospace;
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.8);
    position: relative;
}

.result-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: auto;
    padding-top: 2rem;
    position: relative;
}

.result-actions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.3), transparent);
}

.result-actions .btn-professional {
    min-width: 140px;
    padding: 1rem 2rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.result-actions .btn-professional::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.result-actions .btn-professional:hover::before {
    left: 100%;
}

.result-actions .btn-professional:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.6),
        0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* VIP Responsive alignment for popup */
@media (max-width: 768px) {
    .results-modal {
        padding: 1.5rem;
    }
    
    .results-content {
        padding: 2.5rem 2rem;
        max-width: 100%;
        border-radius: 24px;
    }
    
    .results-title {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }
    
    .result-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
        margin-bottom: 2rem;
    }
    
    .result-item {
        padding: 1rem 0.5rem;
        min-height: 70px;
        border-radius: 16px;
    }
    
    .result-item.buttons-container {
        grid-column: span 2;
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
        padding: 1rem;
    }
    
    .result-item.buttons-container .btn-professional {
        min-width: 120px;
        padding: 0.75rem 1.5rem;
    }
    
    .result-value {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .results-content {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .results-title {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .result-item {
        flex-direction: row;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        min-height: auto;
        border-radius: 12px;
    }
    
    .result-item.buttons-container {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .result-item.buttons-container .btn-professional {
        width: 100%;
        min-width: auto;
    }
    
    .result-label {
        margin-bottom: 0;
        font-size: 0.65rem;
    }
    
    .result-value {
        font-size: 1rem;
    }
}

/* Responsive Professional Design */
@media (max-width: 768px) {
    .test-controls {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .control-section {
        width: 100%;
        justify-content: center;
    }
    
    .timer-section {
        order: -1;
    }
    
    .typing-container {
        grid-template-columns: 1fr;
        height: auto;
        margin: 0 0.5rem 0.5rem;
        width: calc(100% - 1rem);
        gap: 1rem;
    }
    
    .passage-display,
    .typing-textarea {
        min-height: 200px;
        max-height: 300px;
    }
}

/* Stats bar - REMOVED - Statistics removed from test page */

.timer {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffd700;
    font-family: 'Courier New', monospace;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: pulse 2s infinite;
}

.timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.timer-bar {
    width: 200px;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 215, 0, 0.2);
}

.timer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #fbbf24, #f59e0b);
    border-radius: 4px;
    transition: width 1s linear, background 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    position: relative;
}

.timer-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.timer-bar-fill.warning {
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #d97706);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

.timer-bar-fill.danger {
    background: linear-gradient(90deg, #ef4444, #dc2626, #b91c1c);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.7);
}

.timer-bar-fill.critical {
    background: linear-gradient(90deg, #dc2626, #b91c1c, #991b1b);
    box-shadow: 0 0 25px rgba(220, 38, 38, 0.8);
    animation: pulse 0.5s infinite, shimmer 1s infinite;
}

.timer.normal {
    color: #ffd700;
}

.timer.warning {
    color: #fbbf24;
    animation: pulse 1s infinite;
}

.timer.danger {
    color: #ef4444;
    animation: pulse 0.5s infinite;
}

.timer.critical {
    color: #dc2626;
    animation: pulse 0.3s infinite, blink 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.time-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.time-selector label {
    color: #ffd700;
    font-weight: 600;
}

.time-selector select {
    padding: 8px 12px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 6px;
    font-size: 1rem;
    background: #1a1a1a;
    color: #ffd700;
    transition: all 0.3s ease;
}

.time-selector select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

/* Results */
.results {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin: 2rem 0;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.results h2 {
    color: #ffd700;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-item {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.1);
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.result-item .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: countUp 0.5s ease-out;
}

@keyframes countUp {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.result-item .label {
    color: #cccccc;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Text highlighting */
.char-correct { 
    color: #ffd700; 
    background-color: rgba(255, 215, 0, 0.1);
    animation: correctPulse 0.3s ease;
}

@keyframes correctPulse {
    0% { background-color: rgba(255, 215, 0, 0.3); }
    100% { background-color: rgba(255, 215, 0, 0.1); }
}

.char-incorrect { 
    color: #ff6b6b; 
    background-color: rgba(255, 107, 107, 0.1);
    animation: incorrectShake 0.3s ease;
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.char-current { 
    background-color: rgba(255, 215, 0, 0.2); 
    color: #ffd700;
    animation: currentBlink 1s infinite;
}

@keyframes currentBlink {
    0%, 100% { background-color: rgba(255, 215, 0, 0.2); }
    50% { background-color: rgba(255, 215, 0, 0.4); }
}

.char-pending { 
    color: #666666; 
}

/* Animations */
.loading {
    text-align: center;
    padding: 2rem;
    color: #ffd700;
    animation: loadingPulse 1.5s infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Footer */
footer {
    text-align: center; 
    padding: 2rem; 
    color: #666666; 
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

/* Passage Table Styles */
.passage-table-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.passage-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.passage-table th {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #ffd700;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.passage-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    color: #ffd700;
    vertical-align: middle;
}

.passage-row {
    transition: all 0.3s ease;
    cursor: pointer;
}

.passage-row:hover {
    background: rgba(255, 215, 0, 0.05);
    transform: translateX(4px);
}

.passage-row:hover td {
    color: #fff;
}

.title-cell {
    font-weight: 500;
    font-size: 1rem;
}

.difficulty-cell {
    text-align: center;
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.difficulty-badge.easy {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.difficulty-badge.medium {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.difficulty-badge.hard {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.characters-cell, .words-cell {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.action-cell {
    text-align: center;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 640px) {
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .card {
        padding: 1rem;
    }
    
    .test-controls {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .timer {
        font-size: 1.5rem;
    }
    
    .typing-container {
        height: calc(100vh - 80px);
        gap: 0.5rem;
    }
    
    .passage-display, .typing-area {
        padding: 1rem;
    }
    
    .passage-table {
        font-size: 0.9rem;
    }
    
    .passage-table th,
    .passage-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .difficulty-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ffed4e;
}
