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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    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;
}

.brand-title {
    font-size: 3.5em;
    margin-bottom: 5px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 3px;
}

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

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

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
}

.form-section, .result-section {
    padding: 20px;
}

.form-section h2, .result-section h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 1.5em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

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

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

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.api-config {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    margin-bottom: 20px;
}

.api-config label {
    color: #667eea;
    font-weight: 600;
}

.help-text {
    display: block;
    color: #999;
    font-size: 0.85em;
    margin-top: 5px;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 14px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

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

.btn-copy {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(56, 239, 125, 0.4);
}

.btn-save {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

.result-container {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    min-height: 400px;
    margin-bottom: 20px;
}

.result-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.8;
    color: #333;
    font-size: 14px;
}

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

.loading {
    color: #667eea;
    text-align: center;
    padding: 50px 20px;
    font-size: 16px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        color: rgba(0,0,0,0);
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    40% {
        color: #667eea;
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    60% {
        text-shadow:
            .25em 0 0 #667eea,
            .5em 0 0 rgba(0,0,0,0);
    }
    80%, 100% {
        text-shadow:
            .25em 0 0 #667eea,
            .5em 0 0 #667eea;
    }
}

.error {
    color: #f5576c;
    text-align: center;
    padding: 30px 20px;
    font-size: 14px;
    line-height: 1.6;
}

.saved-prompts {
    margin-top: 40px;
}

.saved-prompts h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.saved-list {
    max-height: 300px;
    overflow-y: auto;
}

.saved-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.saved-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.saved-item-title {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.saved-item-date {
    font-size: 0.85em;
    color: #999;
}

.saved-item-content {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-item-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-load:hover {
    background: #5568d3;
}

.btn-delete {
    background: #f5576c;
    color: white;
}

.btn-delete:hover {
    background: #e04a5e;
}

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

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.toast.error {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }
    
    header {
        padding: 30px 20px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
}
