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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    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, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

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

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 15px;
}

.disclaimer {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
    font-size: 0.9em;
}

main {
    padding: 40px;
}

.api-config {
    background: #fff9e6;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 2px solid #ffd54f;
}

.api-key-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.api-key-input-wrapper input {
    flex: 1;
}

.toggle-btn {
    padding: 12px 16px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.toggle-btn:hover {
    background: #e0e0e0;
}

.help-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9em;
    margin-left: 10px;
}

.help-link:hover {
    text-decoration: underline;
}

.api-note {
    display: block;
    margin-top: 8px;
    color: #f57c00;
    font-size: 0.85em;
    line-height: 1.4;
}

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

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

select, input[type="text"], textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    margin: 10px 0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

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

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

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

.loading {
    text-align: center;
    padding: 40px;
}

.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); }
}

.results {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.excuse-card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 5px solid #667eea;
}

.excuse-text {
    font-size: 1.15em;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
}

.excuse-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.believability-badge, .category-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.believability-badge.low {
    background: #ffe0e0;
    color: #d32f2f;
}

.believability-badge.medium {
    background: #fff4e0;
    color: #f57c00;
}

.believability-badge.high {
    background: #e0f7e0;
    color: #388e3c;
}

.category-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.actions {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: #667eea;
    color: white;
}

.tips {
    background: #fff9e6;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border: 2px solid #ffd54f;
}

.tips h3 {
    color: #f57c00;
    margin-bottom: 10px;
}

.tips ul {
    list-style: none;
    padding-left: 0;
}

.tips li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.tips li::before {
    content: "💡";
    position: absolute;
    left: 0;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #c62828;
    margin: 20px 0;
}

footer {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 600px) {
    h1 {
        font-size: 2em;
    }

    .actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }
}
