/* ================================
   CW Trainer - Main Stylesheet
   ================================ */

/* ================================
   RESET AND 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: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================================
   LAYOUT CONTAINERS
   ================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.main-content {
    margin-top: 80px; /* Account for fixed header */
    flex: 1; /* Take up remaining space */
}

/* ================================
   HEADER AND NAVIGATION
   ================================ */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.nav-links span {
    color: #666;
    font-weight: 500;
}

/* ================================
   BUTTONS
   ================================ */
.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    display: inline-block;
    margin: 0 0.5rem;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.btn-secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.btn-large {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-large:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.start-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

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

.stop-btn {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

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

.submit-btn {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

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

/* ================================
   FORM ELEMENTS
   ================================ */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
}

/* ================================
   CARDS AND SECTIONS
   ================================ */
.content-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.training-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.cards-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.feature-card {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid #e9ecef;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.auth-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

/* ================================
   CHARACTER CARDS
   ================================ */
.card-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    user-select: none;
}

.card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.card-item:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.card-inactive {
    background: #e9ecef;
    color: #6c757d;
}

.card-learning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.card-new-review {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.card-young {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.card-mature {
    background: #cce5ff;
    border-color: #007bff;
    color: #004085;
}

.card-difficult {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* ================================
   GRIDS
   ================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid transparent;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* ================================
   HERO AND SECTIONS
   ================================ */
.hero {
    padding: 40px 2rem 80px;
    text-align: center;
    color: white;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.overview-header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.overview-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.training-section {
    padding: 40px 0 80px;
    min-height: 100vh;
}

.training-container h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #333;
    font-weight: 600;
}

.features {
    background: white;
    padding: 80px 2rem;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.how-it-works {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    padding: 80px 2rem;
    color: white;
}

.how-it-works h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.cta-section {
    background: #2c3e50;
    padding: 80px 2rem;
    text-align: center;
    color: white;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.footer {
    background: #1a252f;
    padding: 2rem;
    text-align: center;
    color: white;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-nav {
    margin-bottom: 1rem;
}

.footer-nav a {
    color: #64b5f6;
    text-decoration: none;
    margin: 0 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-text {
    opacity: 0.8;
    font-size: 0.9rem;
}

.footer-text p {
    margin: 0;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: #333;
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.auth-header p {
    color: #666;
    margin: 0;
}

/* ================================
   SPECIFIC ELEMENTS
   ================================ */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 2rem 2rem;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
    font-weight: 600;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
}

.step {
    text-align: center;
    padding: 2rem;
}

.step-number {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.step h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.step p {
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.controls {
    margin: 2rem 0;
}

.morse-demo {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
}

.morse-text {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    margin: 1rem 0;
    letter-spacing: 3px;
}

/* ================================
   DISPLAY AREAS
   ================================ */
#display-area {
    font-size: 3rem;
    margin: 2rem 0;
    padding: 2rem;
    border: 3px solid #e0e0e0;
    border-radius: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}

#input-area {
    font-size: 2rem;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    text-align: center;
    margin: 1rem 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

#input-area:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ================================
   ALERTS AND MESSAGES
   ================================ */
.error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
    border-radius: 0.25rem;
}

.success {
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #c3e6cb;
    border-radius: 0.25rem;
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */
@media (max-width: 768px) {
    .header {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
        position: static; /* Remove fixed positioning on mobile */
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav-links {
        gap: 0.25rem;
        flex-wrap: wrap;
    }
    
    .nav-links a {
        padding: 0.3rem 0.5rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .nav-links span {
        display: none;
    }
    
    .main-content {
        margin-top: 0; /* Remove top margin since header is not fixed */
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .features h2, .how-it-works h2, .cta-section h2 {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .training-container,
    .content-section,
    .cards-section {
        padding: 2rem 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    #display-area {
        font-size: 2rem;
        padding: 1rem;
        min-height: 80px;
    }
    
    #input-area {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .footer-nav a {
        margin: 0 0.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .overview-header h1 {
        font-size: 2.5rem;
    }
    
    .training-container h2 {
        font-size: 1.5rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
    
    .card-item {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    #display-area {
        font-size: 1.5rem;
    }
    
    #input-area {
        font-size: 1.25rem;
    }
    
    .footer-nav {
        margin-bottom: 1.5rem;
    }
    
    .footer-nav a {
        display: block;
        margin: 0.5rem 0;
        font-size: 0.9rem;
    }
}

/* ================================
   UTILITY CLASSES
   ================================ */
.text-center {
    text-align: center;
}

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

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

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 1rem; }
.pt-4 { padding-top: 1.5rem; }
.pt-5 { padding-top: 3rem; }

.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 1rem; }
.pb-4 { padding-bottom: 1.5rem; }
.pb-5 { padding-bottom: 3rem; }

.hidden {
    display: none;
}

.visible {
    display: block;
}

.flex {
    display: flex;
}

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

.full-height {
    min-height: 100vh;
}

.full-height-auth {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* ================================
   FAQ STYLES
   ================================ */
.faq-list {
    margin-top: 2rem;
}

.faq-item {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h2 {
    color: #667eea;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.faq-item p {
    color: #555;
    line-height: 1.7;
    font-size: 1rem;
}
