/**
 * Copyright 2026 by Kilian Q. Weinberger
 * Version: 0.1.0
 * License: MIT License
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/* N-Gram Text Generator Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
}

section {
    padding: 30px;
    border-bottom: 1px solid #e0e0e0;
}

section:last-of-type {
    border-bottom: none;
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.info-panel p {
    color: #666;
    line-height: 1.8;
}

.control-group {
    margin-bottom: 25px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    color: #444;
}

.help-text {
    display: block;
    font-size: 0.85em;
    color: #888;
    font-weight: normal;
    margin-top: 4px;
}

.current-value {
    display: inline-block;
    margin-left: 15px;
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.9em;
    color: #555;
    font-weight: 600;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input[type="number"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

input[type="number"]:disabled,
input[type="text"]:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.primary-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

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

.primary-btn:active:not(:disabled) {
    transform: translateY(0);
}

.primary-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

.primary-btn.loading .btn-text {
    display: none;
}

.primary-btn.loading .btn-loading {
    display: inline;
}

.status-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.95em;
    text-align: center;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.stats-panel {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.stats-panel ul {
    list-style: none;
}

.stats-panel li {
    padding: 8px 0;
    color: #555;
}

.stats-panel strong {
    color: #333;
}

.output-box {
    min-height: 200px;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.05em;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-box .placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 80px 20px;
}

.output-box.has-content {
    background: white;
    border-color: #667eea;
}

footer {
    background: #f8f9fa;
    padding: 25px 30px;
    border-top: 1px solid #e0e0e0;
}

footer p {
    color: #666;
    font-size: 0.9em;
    line-height: 1.7;
}

/* Responsive Design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 1em;
    }

    section {
        padding: 20px;
    }

    h2 {
        font-size: 1.3em;
    }

    .current-value {
        display: block;
        margin-left: 0;
        margin-top: 8px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.primary-btn.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
