/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #0a0e27;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}

/* Navigation Bar */
.navbar {
    background: rgba(10, 14, 39, 0.95);
    border-bottom: 1px solid #1a1f3a;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

.logo h1 {
    font-size: 1.8em;
    color: #fff;
    font-weight: 700;
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    color: #b0b0b0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #fff;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    background: linear-gradient(135deg, #1a1f3a 0%, #0f1a2e 100%);
    color: white;
    padding: 80px 40px;
    text-align: center;
    border-bottom: 1px solid #1a1f3a;
}

.header-content h1 {
    font-size: 3.5em;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: -2px;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-content p {
    font-size: 1.3em;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
    color: #b0b0b0;
}

/* Main Content */
main {
    padding: 60px 40px;
}

/* Cards */
.card {
    background: linear-gradient(135deg, #0f1a2e 0%, #1a1f3a 100%);
    border: 1px solid #1a1f3a;
    border-radius: 12px;
    padding: 35px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: #2a3052;
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.1);
}

.card h2 {
    color: #00d4ff;
    font-size: 1.6em;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* API Key Section */
.api-key-section {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(0, 153, 204, 0.05) 100%);
    border: 2px dashed #00d4ff;
}

.api-key-section h2 {
    color: #00d4ff;
}

.api-key-section small {
    color: #00d4ff;
    font-weight: 500;
}

.api-key-section a {
    color: #00d4ff;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.api-key-section a:hover {
    opacity: 0.8;
}

/* Forms */
.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #e0e0e0;
    letter-spacing: 0.3px;
}

.form-input,
.form-textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #2a3052;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #666;
}

.form-input:focus,
.form-textarea:focus,
select:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

small {
    display: block;
    color: #888;
    margin-top: 8px;
    font-size: 0.9em;
}

/* Fieldset */
fieldset {
    border: none;
    padding: 0;
    margin-bottom: 30px;
}

legend {
    font-size: 1.2em;
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #1a1f3a;
    width: 100%;
    letter-spacing: 0.3px;
}

/* Control Group (Sliders) */
.control-group {
    display: grid;
    gap: 25px;
}

.control-item {
    padding: 20px;
    background: rgba(0, 212, 255, 0.03);
    border-radius: 8px;
    border: 1px solid #2a3052;
    transition: all 0.3s ease;
}

.control-item:hover {
    border-color: #00d4ff;
}

.control-item label {
    margin-bottom: 12px;
    font-weight: 500;
}

.control-item span {
    color: #00d4ff;
    font-weight: 700;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #2a3052;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.5);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    background: #00a3cc;
    box-shadow: 0 2px 12px rgba(0, 212, 255, 0.7);
    transform: scale(1.15);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.5);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    background: #00a3cc;
    box-shadow: 0 2px 12px rgba(0, 212, 255, 0.7);
    transform: scale(1.15);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #0a0e27;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #2a3052;
    color: #e0e0e0;
    border: 1px solid #3a4062;
}

.btn-secondary:hover {
    background: #3a4062;
    border-color: #00d4ff;
    color: #00d4ff;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.1em;
    margin-top: 15px;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

/* Results Section */
.results-section {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(0, 153, 204, 0.05) 100%);
    border: 2px solid #00d4ff;
}

.results-section h2 {
    color: #00d4ff;
}

.result-item {
    padding: 15px;
    margin-bottom: 15px;
    background: rgba(0, 212, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid #00d4ff;
}

.result-item strong {
    display: block;
    margin-bottom: 10px;
    color: #e0e0e0;
}

.result-item code {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 14px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    color: #00d4ff;
    word-break: break-all;
    display: block;
    margin-bottom: 10px;
    border: 1px solid #2a3052;
}

.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.status-badge.pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.status-badge.complete {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.status-badge.processing {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border: 1px solid #00d4ff;
}

/* Error Section */
.error-section {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.05) 0%, rgba(211, 47, 47, 0.05) 100%);
    border: 2px solid #f44336;
}

.error-section h2 {
    color: #f44336;
}

.error-section p {
    color: #ff6b6b;
    background: rgba(244, 67, 54, 0.05);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #f44336;
}

/* Loading Indicator */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.spinner {
    border: 4px solid rgba(0, 212, 255, 0.2);
    border-top: 4px solid #00d4ff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: #00d4ff;
    font-size: 1.1em;
    margin-top: 25px;
    font-weight: 500;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #0a0e27 0%, #0f1a2e 100%);
    border-top: 1px solid #1a1f3a;
    padding: 40px;
    text-align: center;
    color: #888;
    font-size: 0.95em;
}

footer p {
    margin-bottom: 10px;
}

footer a {
    color: #00d4ff;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

footer a:hover {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-content {
        padding: 0 20px;
    }

    header {
        padding: 60px 20px;
    }

    .header-content h1 {
        font-size: 2.2em;
    }

    .header-content p {
        font-size: 1.1em;
    }

    main {
        padding: 30px 20px;
    }

    .card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .card h2 {
        font-size: 1.3em;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .nav-links {
        gap: 20px;
        font-size: 0.95em;
    }
}