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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #666666 0%, #333333 100%); /* Replaced vibrant gradient with gray gradient */
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, #000000 0%, #333333 100%); /* Replaced blue gradient with black to dark gray */
    color: white;
    padding: 30px;
    text-align: center;
}

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

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
}

.input-section h2,
.output-section h2 {
    color: #333333; /* Dark gray for text */
    margin-bottom: 25px;
    font-size: 1.5rem;
    border-bottom: 3px solid #000000; /* Changed border to black */
    padding-bottom: 10px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333333; /* Dark gray for labels */
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #cccccc; /* Light gray border */
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8f8f8; /* Very light gray background */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #000000; /* Black border on focus */
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Kept shadow as is (black with low opacity) */
}

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

.form-group small {
    color: #666666; /* Medium gray for small text */
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Button Styles */
.generate-btn {
    width: 100%;
    background: linear-gradient(135deg, #000000, #333333); /* Black to dark gray gradient */
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 20px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3); /* Black shadow */
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.generate-btn.loading .btn-text {
    opacity: 0;
}

.generate-btn.loading .loading-spinner {
    opacity: 1;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3); /* Kept spinner as white with transparency */
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Output Section */
.content-output {
    background: #f8f8f8; /* Very light gray background */
    border: 2px solid #cccccc; /* Light gray border */
    border-radius: 15px;
    padding: 25px;
    min-height: 200px;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.content-output.has-content {
    background: white;
    border-color: #000000; /* Black border when content is present */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Black shadow */
}

.content-output .placeholder {
    color: #999999; /* Medium gray for placeholder */
    font-style: italic;
    text-align: center;
    margin-top: 50px;
}

.content-output .generated-text {
    color: #333333; /* Dark gray for generated text */
    line-height: 1.7;
    white-space: pre-wrap;
    animation: fadeIn 0.5s ease-out;
}

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

.output-actions {
    display: flex;
    gap: 15px;
}

.copy-btn,
.regenerate-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn {
    background: #000000; /* Black for copy button */
    color: white;
}

.copy-btn:hover:not(:disabled) {
    background: #333333; /* Dark gray on hover */
    transform: translateY(-2px);
}

.copy-btn.copied {
    background: #666666; /* Medium gray when copied */
}

.regenerate-btn {
    background: #666666; /* Medium gray for regenerate button */
    color: white;
}

.regenerate-btn:hover:not(:disabled) {
    background: #4d4d4d; /* Slightly darker gray on hover */
    transform: translateY(-2px);
}

.copy-btn:disabled,
.regenerate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* API Configuration */
.api-config {
    background: #f8f8f8; /* Very light gray background */
    padding: 30px 40px;
    border-top: 1px solid #cccccc; /* Light gray border */
}

.api-config h3 {
    color: #333333; /* Dark gray for heading */
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .output-actions {
        flex-direction: column;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1; /* Light gray track */
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #000000; /* Black thumb */
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #333333; /* Dark gray on hover */
}

/* Success Animation */
.success-pulse {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}