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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    font-style: italic;
}

main {
    padding: 30px;
}

#input-section {
    margin-bottom: 40px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

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

#generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#haiku-display {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

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

#haiku-content {
    font-size: 1.4em;
    line-height: 2;
    text-align: center;
    white-space: pre-line;
    color: #333;
    font-style: italic;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

#haiku-inputs {
    font-size: 0.9em;
    color: #666;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

#haiku-inputs span {
    display: inline-block;
    margin: 0 10px;
    padding: 5px 12px;
    background: #e9ecef;
    border-radius: 15px;
}

#loading {
    text-align: center;
    padding: 40px;
    margin-bottom: 30px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#error {
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.error-message {
    color: #c33;
    text-align: center;
}

#history-section {
    margin-top: 40px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h2 {
    color: #667eea;
    font-size: 1.5em;
}

.btn-secondary {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

#history-list {
    display: grid;
    gap: 20px;
}

.history-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s, box-shadow 0.2s;
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.history-item .haiku-text {
    font-size: 1.2em;
    line-height: 1.8;
    text-align: center;
    white-space: pre-line;
    font-style: italic;
    color: #333;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.history-item .haiku-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: #666;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.history-item .haiku-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.history-item .haiku-tags span {
    padding: 4px 10px;
    background: #e9ecef;
    border-radius: 12px;
    font-size: 0.85em;
}

.history-item .haiku-date {
    color: #999;
}

.hidden {
    display: none;
}

.empty-history {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

