/* Poetry Stress Pattern Analyzer Styles */

.container *,
.container *::before,
.container *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.container header {
    text-align: center;
    margin-bottom: 2rem;
}

.container header h1 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    font-size: 1rem;
}

/* Input Section */
.input-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

#poem-input {
    width: 100%;
    height: 200px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.2s;
}

#poem-input:focus {
    outline: none;
    border-color: #3498db;
}

.button-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.container button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-btn {
    background-color: #3498db;
    color: white;
}

.primary-btn:hover {
    background-color: #2980b9;
}

.primary-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.secondary-btn {
    background-color: #ecf0f1;
    color: #333;
}

.secondary-btn:hover {
    background-color: #bdc3c7;
}

/* Legend */
.legend {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.legend h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

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

.legend-item .mark {
    font-size: 1.35rem;
}

.legend-hint {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.75rem;
}

/* Output Section */
.output-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.output-section.hidden {
    display: none;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.output-header h2 {
    font-size: 1.25rem;
    color: #2c3e50;
}

.output-actions {
    display: flex;
    gap: 0.5rem;
}

/* Poem Output */
.poem-output {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 1.1rem;
    line-height: 2;
}

.poem-line {
    display: block;
    margin-bottom: 0.5rem;
}

.word {
    display: inline-flex;
    flex-wrap: nowrap;
    vertical-align: bottom;
}

.char-col {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.15s;
}

.char-col .mark {
    font-size: 1.15em;
    height: 0.7rem;
    line-height: 0.7rem;
    margin-bottom: -0.35rem;
}

/* Stress mark colors */
.mark.stressed {
    color: #2c3e50;
}

.mark.unstressed {
    color: #95a5a6;
}

.mark.no-mark {
    visibility: hidden;
}

/* Statistics */
.statistics {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #666;
}

.statistics p {
    margin-bottom: 0.25rem;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #ecf0f1;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error */
.error {
    background: #fdf2f2;
    color: #c0392b;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e74c3c;
}

.error.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    .container header h1 {
        font-size: 1.5rem;
    }

    .legend-items {
        gap: 1rem;
    }

    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .button-row {
        flex-direction: column;
    }

    .container button {
        width: 100%;
    }
}
