/* ============================================
   Excel to Web API Converter — Styles
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366F1;
    --secondary: #818CF8;
    --accent: #34D399;
    --bg: #0F0B1E;
    --bg-card: #16122B;
    --bg-elevated: #1E1938;
    --bg-input: #242044;
    --border: rgba(99, 102, 241, 0.15);
    --border-hover: rgba(99, 102, 241, 0.35);
    --text: #F0ECF9;
    --text-sec: #A5A0C8;
    --text-muted: #6B6490;
    --success: #34D399;
    --warning: #FBBF24;
    --error: #FB7185;
    --radius: 12px;
    --font: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --tr: 250ms ease;
}

html {
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 1.5rem;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, .07) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(52, 211, 153, .05) 0%, transparent 50%);
}

.app {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Header */
.header {
    text-align: center;
    padding: 0.5rem 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-sec);
    font-size: 0.82rem;
    margin-top: 0.15rem;
}

/* Drop Zone */
.upload-section {
    display: flex;
    justify-content: center;
}

.drop-zone {
    width: 100%;
    max-width: 600px;
    padding: 3rem 2rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    text-align: center;
    cursor: pointer;
    transition: var(--tr);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: var(--bg-elevated);
    box-shadow: 0 0 24px rgba(99, 102, 241, .15);
}

.drop-icon {
    margin-bottom: 1rem;
}

.drop-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

.drop-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* Panels */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.panel-title {
    font-size: 0.85rem;
    font-weight: 700;
}

.panel-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sheet Tabs */
.sheet-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.sheet-tabs::-webkit-scrollbar {
    display: none;
}

.sheet-tab {
    padding: 0.45rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    color: var(--text-sec);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--tr);
    white-space: nowrap;
    border-bottom: none;
}

.sheet-tab:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.sheet-tab.active {
    background: var(--primary);
    color: white;
    border-color: transparent;
}

/* Data Table */
.table-wrapper {
    overflow: auto;
    max-height: 320px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.data-table th {
    position: sticky;
    top: 0;
    background: var(--bg-elevated);
    color: var(--text-sec);
    text-align: left;
    padding: 0.55rem 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table td {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid rgba(99, 102, 241, .07);
    color: var(--text);
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, .05);
}

.type-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(99, 102, 241, .15);
    color: var(--secondary);
    font-weight: 600;
    font-family: var(--mono);
    margin-left: 0.35rem;
}

/* API Explorer */
.endpoints {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.endpoint-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg-input);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--tr);
}

.endpoint-item:hover {
    background: var(--bg-elevated);
}

.method-badge {
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--mono);
    color: white;
}

.method-badge.get,
.method-badge {
    background: var(--accent);
    color: #0F0B1E;
}

.method-badge.post {
    background: var(--warning);
    color: #0F0B1E;
}

.method-badge.put {
    background: var(--secondary);
}

.method-badge.delete {
    background: var(--error);
}

.endpoint-path {
    color: var(--text);
}

/* Try Section */
.try-section {
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.try-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.url-input-group {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.url-base {
    padding: 0.45rem 0.5rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 0.45rem 0.5rem;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.78rem;
}

.btn-send {
    padding: 0.5rem 1rem;
    background: var(--primary);
    border: none;
    color: white;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--tr);
}

.btn-send:hover {
    background: #5558E6;
}

.btn-send:active {
    transform: scale(0.96);
}

/* Query Params */
.query-params {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.param-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.param-row label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-sec);
    font-weight: 500;
}

.param-input {
    padding: 0.35rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.75rem;
    font-family: var(--mono);
    outline: none;
    width: 100px;
    transition: border-color var(--tr);
}

.param-input:focus {
    border-color: var(--primary);
}

.param-num {
    width: 60px;
}

.param-select {
    padding: 0.35rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.75rem;
    font-family: var(--font);
    outline: none;
    cursor: pointer;
}

/* Response */
.response-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.response-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.response-status {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--mono);
}

.response-status.error {
    color: var(--error);
}

.response-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.cors-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    background: rgba(52, 211, 153, .08);
    border-radius: 6px;
    font-size: 0.68rem;
}

.cors-label {
    color: var(--text-muted);
    font-weight: 600;
}

.cors-preview code {
    color: var(--accent);
    font-family: var(--mono);
}

.response-body {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.6;
    color: var(--accent);
    overflow: auto;
    max-height: 300px;
    white-space: pre-wrap;
}

/* Delay */
.delay-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-sec);
    font-weight: 500;
}

.num-input {
    width: 55px;
    padding: 0.3rem 0.4rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.75rem;
    font-family: var(--mono);
    text-align: center;
    outline: none;
}

.num-input:focus {
    border-color: var(--primary);
}

.unit {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Export */
.export-actions {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.btn-export {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-sec);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--tr);
}

.btn-export:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
    color: var(--text);
}

.btn-export:active {
    transform: scale(0.96);
}

/* Utility */
.hidden {
    display: none !important;
}

.btn-sm {
    padding: 0.25rem 0.55rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-sec);
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--font);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--tr);
}

.btn-sm:hover {
    background: var(--primary);
    color: white;
    border-color: transparent;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 0.6rem 1.2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: var(--text);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
    opacity: 0;
    transition: 350ms cubic-bezier(.16, 1, .3, 1);
    z-index: 100;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    .try-header {
        flex-wrap: wrap;
    }

    .param-row {
        flex-direction: column;
    }

    .param-input {
        width: 100%;
    }

    .export-actions {
        flex-direction: column;
    }
}