/* === Base Layout === */
.playground-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.playground-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 24px;
}

/* === Cards === */
.parameters-card,
.upload-card,
.response-panel {
    background: #ffffff;
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease, border-color 0.3s ease;
}

body.ocean-dark-mode .parameters-card,
body.ocean-dark-mode .upload-card,
body.ocean-dark-mode .response-panel {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* === Section Titles === */
.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 15px;
}

body.ocean-dark-mode .section-title {
    color: #93c5fd;
}

/* === Form Elements === */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: #1e3a8a;
}

body.ocean-dark-mode .form-label {
    color: #93c5fd;
}

/* === Dropdown Styling (Final Fixed Version with Arrow & Correct Color) === */
.form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #d4d8ff;
    border-radius: 8px;
    color: #3742a0;
    background-color: #f8f9ff;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%235056d0' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select:hover {
    border-color: #b3b8ff;
}

.form-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background-color: #ffffff;
}

.form-select option {
    color: #1e293b;
    background-color: #ffffff;
}

/* === Dark Mode Variant === */
body.ocean-dark-mode .form-select {
    background-color: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2393c5fd' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}

body.ocean-dark-mode .form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}

body.ocean-dark-mode .form-select option {
    color: #e2e8f0;
    background-color: #1e293b;
}

/* === Upload Area === */
.upload-area {
    border: 2px dashed #a5b4fc;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area.dragover {
    background: #eef2ff;
    border-color: #6366f1;
}

.upload-icon svg {
    color: #4f46e5;
    margin-bottom: 8px;
}

.upload-text {
    font-size: 14px;
    color: #374151;
}

.upload-text .browse-link {
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
}

.upload-hint {
    font-size: 12px;
    color: #6b7280;
}

.file-input {
    display: none;
}

.file-display {
    margin-top: 12px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1f2937;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
}

body.ocean-dark-mode .upload-area {
    background: #1e293b;
    border-color: #475569;
}

body.ocean-dark-mode .upload-text {
    color: #cbd5e1;
}

body.ocean-dark-mode .upload-hint {
    color: #94a3b8;
}

body.ocean-dark-mode .file-info {
    background: #334155;
    color: #e2e8f0;
}

/* === Buttons === */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1e40af;
}

.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

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

body.ocean-dark-mode .btn-secondary {
    background: #334155;
    color: #f1f5f9;
}

body.ocean-dark-mode .btn-secondary:hover {
    background: #475569;
}

/* === Response Panel === */
.response-panel {
    margin-top: 20px;
}

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

.api-response {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    font-family: "Courier New", monospace;
    font-size: 14px;
    overflow-x: auto;
    white-space: pre-wrap;
    line-height: 1.5;
    border: 1px solid #b5d1ff;
    max-height: 380px;
}

/* === Toolbar (CSV / TXT / JSON Icons) === */
.response-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    /* margin-bottom: 10px; */
}

.icon-btn {
    background: none;
    border: none;
    color: #475569;
    font-size: 17px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.icon-btn:hover {
    color: #1e40af;
}

body.ocean-dark-mode .icon-btn {
    color: #cbd5e1;
}

body.ocean-dark-mode .icon-btn:hover {
    color: #60a5fa;
}

/* === Copy Icon inside Response Box === */
.response-box-wrapper {
    position: relative;
}

.copy-icon-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #e2e8f0;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    padding: 6px;
    transition: background 0.2s ease, transform 0.15s ease;
}

.copy-icon-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.05);
}

body.ocean-dark-mode .copy-icon-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #93c5fd;
}

body.ocean-dark-mode .copy-icon-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.response-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    transition: color 0.3s, transform 0.2s;
}

/* Light Mode Colors */
body:not(.ocean-dark-mode) #downloadCSV i {
    color: #2e8b57;
    /* Green */
}

body:not(.ocean-dark-mode) #downloadTXT i {
    color: #007bff;
    /* Blue */
}

body:not(.ocean-dark-mode) #downloadJSON i {
    color: #e63946;
    /* Red */
}

/* Dark Mode Colors */
body.ocean-dark-mode #downloadCSV i {
    color: #7CFC00;
    /* Bright Green */
}

body.ocean-dark-mode #downloadTXT i {
    color: #00BFFF;
    /* Sky Blue */
}

body.ocean-dark-mode #downloadJSON i {
    color: #FF6347;
    /* Tomato Red */
}

/* Hover Effects */
.icon-btn:hover i {
    transform: scale(1.15);
    filter: brightness(1.2);
}


/* === Loader Overlay === */
.overlay-loader {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 15, 30, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.overlay-loader.active {
    display: flex;
}

.spinner {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 10px solid rgba(255, 255, 255, 0.12);
    border-top-color: #1e40af;
    animation: spin 1s linear infinite;
    box-shadow: 0 6px 30px rgba(30, 64, 175, 0.2);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === Dark Mode Adjustments for Response Box === */
body.ocean-dark-mode .api-response {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #475569;
}

body.ocean-dark-mode .response-panel {
    background: #1f2937;
    border-color: #334155;
}

body.ocean-dark-mode .response-header h3 {
    color: #93c5fd;
}

/* === Utility Enhancements === */
.dragover * {
    pointer-events: none;
}

.file-info i {
    color: #2563eb;
}

body.ocean-dark-mode .file-info i {
    color: #60a5fa;
}