:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #7209b7;
    --accent-color: #4cc9f0;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #1a1a2e;
    --dark-light: #2d3047;
    --gray-color: #8b8c9c;
    --gray-light: #eef2f7;
    --white: #ffffff;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--dark-color);
    line-height: 1.6;
}

.app-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    min-height: 700px;
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-hover);
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Left Panel - Form */
.form-panel {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    background: var(--white);
    overflow-y: auto;
}

.header-section {
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 30px;
}

.logo i {
    font-size: 24px;
}

.form-title h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-title h1 i {
    color: var(--primary-color);
}

.subtitle {
    color: var(--gray-color);
    font-size: 16px;
    font-weight: 400;
}

/* Form Styling */
.form-wrapper {
    flex: 1;
}

.modern-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.form-field-group {
    background: var(--gray-light);
    border-radius: 12px;
    padding: 24px;
    transition: var(--transition);
    border: 2px solid transparent;
}

.form-field-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    transform: translateY(-2px);
}

.field-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.field-icon {
    width: 48px;
    height: 48px;
    background: var(--white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.field-label {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
    display: block;
    margin-bottom: 6px;
}

.field-hint {
    font-size: 14px;
    color: var(--gray-color);
}

/* Input Groups */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    padding: 0 16px;
    height: 56px;
    background: var(--white);
    border: 2px solid #e0e4e8;
    border-right: none;
    border-radius: 12px 0 0 12px;
    display: flex;
    align-items: center;
    font-weight: 500;
    color: var(--dark-color);
}

.form-input {
    flex: 1;
    height: 56px;
    padding: 0 20px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    border: 2px solid #e0e4e8;
    border-left: none;
    border-radius: 0 12px 12px 0;
    background: var(--white);
    transition: var(--transition);
    color: var(--dark-color);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-input::placeholder {
    color: #a0a4b8;
}

/* Select Styling */
.select-wrapper {
    position: relative;
}

.form-select {
    width: 100%;
    height: 56px;
    padding: 0 20px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    border: 2px solid #e0e4e8;
    border-radius: 12px;
    background: var(--white);
    appearance: none;
    cursor: pointer;
    transition: var(--transition);
    color: var(--dark-color);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.select-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--gray-color);
    transition: var(--transition);
}

.form-select:focus + .select-arrow {
    color: var(--primary-color);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.btn-primary, .btn-secondary, .btn-icon {
    height: 56px;
    padding: 0 32px;
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-spinner {
    display: none;
    margin-left: 8px;
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark-color);
    border: 2px solid #e0e4e8;
}

.btn-secondary:hover {
    background: #e4e7ec;
    transform: translateY(-2px);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    background: var(--gray-light);
    color: var(--gray-color);
}

.btn-icon:hover {
    background: #e4e7ec;
    color: var(--dark-color);
}

/* Form Status */
.form-status {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
    background: var(--gray-light);
    border-radius: 12px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--gray-color);
}

.status-item i {
    font-size: 12px;
}

.status-item.required {
    color: var(--error-color);
}

/* Validation Messages */
.validation-message {
    margin-top: 10px;
    font-size: 14px;
    min-height: 20px;
    padding: 0 4px;
}

.validation-message.error {
    color: var(--error-color);
}

.validation-message.success {
    color: var(--success-color);
}

/* API Info */
.api-info {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--gray-light);
}

.api-info h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.endpoint-display {
    background: var(--dark-color);
    color: var(--accent-color);
    padding: 16px;
    border-radius: 8px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    overflow-x: auto;
}

/* Right Panel - Response */
.response-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--dark-color), #16213e);
    color: var(--white);
    padding: 40px;
    overflow-y: auto;
}

.response-header {
    margin-bottom: 40px;
}

.response-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.response-title h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.response-title h2 i {
    color: var(--accent-color);
}

.response-controls {
    display: flex;
    gap: 10px;
}

.response-stats {
    display: flex;
    gap: 30px;
}

.stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 160px;
}

.stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--white);
}

/* Response Container */
.response-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.response-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.4);
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.response-placeholder h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.response-placeholder p {
    font-size: 16px;
    max-width: 400px;
}

/* Response Tabs */
.response-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.tab-btn {
    padding: 10px 24px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: var(--transition);
    position: relative;
}

.tab-btn:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--accent-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-color);
}

.tab-content {
    flex: 1;
    overflow: auto;
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content pre {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 300px;
    overflow-y: auto;
}

/* Request Details */
.request-details {
    margin-top: 20px;
}

.request-details h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-color);
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.param {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.param-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.param-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    color: var(--white);
    word-break: break-all;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }
    
    .form-panel, .response-panel {
        padding: 30px;
    }
    
    .response-stats {
        flex-wrap: wrap;
    }
    
    .stat {
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .app-container {
        margin: 10px;
    }
    
    .form-panel, .response-panel {
        padding: 20px;
    }
    
    .form-title h1 {
        font-size: 24px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
    
    .form-status {
        flex-direction: column;
        gap: 10px;
    }
    
    .params-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation for success */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

.form-field-group.valid {
    border-color: var(--success-color);
    animation: pulse 2s infinite;
}