/* Code Group Training - Custom Styles */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    max-width: 400px;
}

/* Code Group Display */
.code-group-display {
    background: linear-gradient(135deg, #1f2937, #374151);
    border: 3px solid #4b5563;
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.code-group-display-hidden {
    border-color: #6b7280;
    background: linear-gradient(135deg, #374151, #4b5563);
}

.code-group-display-revealed {
    border-color: #10b981;
    background: linear-gradient(135deg, #065f46, #047857);
}

.code-group-display-active {
    border-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
}

/* User Input Field */
.user-input-field {
    width: 100%;
    min-height: 120px;
    font-size: 1.25rem;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    padding: 1rem;
    border: 2px solid #374151;
    border-radius: 0.5rem;
    background: #1f2937;
    color: white;
    resize: vertical;
}

.user-input-field:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.user-input-field:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
}

.btn-info {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-info:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
}

/* Mode Options */
.mode-option {
    background: #1f2937;
    border: 2px solid #4b5563;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-option:hover {
    border-color: #6b7280;
    background: #374151;
}

.mode-option.active {
    background: #1e40af;
    border-color: #3b82f6;
    color: white;
}

.mode-option.active .text-gray-400 {
    color: rgb(209, 213, 219) !important;
}

/* Character Grid */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.char-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #374151;
    border: 2px solid #4b5563;
    border-radius: 0.375rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.char-checkbox:hover {
    background: #4b5563;
}

.char-checkbox input[type="checkbox"] {
    display: none;
}

.char-checkbox input[type="checkbox"]:checked + label {
    background: #10b981;
    border-color: #059669;
}

.char-checkbox label {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 1.125rem;
    font-weight: bold;
    cursor: pointer;
    background: #374151;
    border: 2px solid #4b5563;
    border-radius: 0.375rem;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

.char-checkbox input[type="checkbox"]:checked + label {
    background: #10b981;
    border-color: #059669;
    color: white;
}

/* Slider Container */
.slider-container {
    position: relative;
}

.slider-value {
    position: absolute;
    top: -25px;
    right: 0;
    background: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #10b981;
}

/* Stat Items */
.stat-item {
    position: relative;
}

/* Section */
.section {
    isolation: isolate;
    position: relative;
}

.section-header {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    min-height: 40px;
}

/* Character Heatmap Cells */
.heatmap-cell {
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    z-index: 10;
}

.heatmap-perfect {
    background: #10b981;
    color: white;
}

.heatmap-good {
    background: #84cc16;
    color: white;
}

.heatmap-ok {
    background: #eab308;
    color: white;
}

.heatmap-bad {
    background: #f97316;
    color: white;
}

.heatmap-poor {
    background: #ef4444;
    color: white;
}

.heatmap-unused {
    background: #374151;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .code-group-display {
        padding: 2rem 1rem;
        font-size: 1.25rem;
        min-height: 120px;
    }

    .user-input-field {
        font-size: 1rem;
        min-height: 100px;
    }

    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 0.375rem;
    }

    .char-checkbox label {
        font-size: 1rem;
        padding: 0.375rem;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .code-group-display {
        padding: 1.5rem 0.75rem;
        font-size: 1.125rem;
        min-height: 100px;
    }

    .user-input-field {
        font-size: 0.875rem;
        min-height: 80px;
    }

    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 0.25rem;
    }

    .char-checkbox label {
        font-size: 0.875rem;
        padding: 0.25rem;
    }
}