:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --accent-color: #3b82f6;
    --hover-color: #2563eb;
    --border-color: #1e293b;
    --surface-color: #1e293b;
    --header-bg: #131c2f;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    padding: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--accent-color), var(--hover-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    color: #94a3b8;
    font-size: 1.1rem;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    background: var(--surface-color);
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.drop-zone-content i {
    font-size: 3rem;
    color: var(--accent-color);
}

.or-divider {
    color: #64748b;
    margin: 1rem 0;
}

.primary-button {
    background: linear-gradient(to bottom, var(--accent-color), var(--hover-color));
    color: var(--text-color);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    background: var(--hover-color);
}

.primary-button i {
    font-size: 1.2rem;
    opacity: 1;
    color: white;
}

.primary-button:hover i {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.url-section {
    margin-bottom: 2rem;
}

.url-input {
    display: flex;
    gap: 1rem;
    background: var(--surface-color);
    padding: 0.75rem;
    border-radius: 0.5rem;
    align-items: center;
}

.url-input input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
}

.url-input i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.api-config {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
}

.help-text {
    display: block;
    color: #64748b;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.result {
    background: var(--surface-color);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 8px 30px -5px rgba(0, 0, 0, 0.3),
                0 1px 4px rgba(0, 0, 0, 0.2);
    margin-top: 2rem;
    max-width: 100%;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease-in-out;
    opacity: 1;
}

.result[hidden] {
    opacity: 0;
    transform: translateY(10px);
}

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

.result-header h2 {
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
}

.result-wrapper {
    padding: 1.5rem;
    background: var(--surface-color);
    margin: 0;
    border-radius: 0 0 0.75rem 0.75rem;
    position: relative;
    min-height: 200px;
}

.result pre {
    margin: 0;
    padding: 1.5rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    max-width: 100%;
    text-align: left;
    color: var(--text-color);
    transition: opacity 0.3s ease;
}

.copy-button {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    opacity: 0.8;
}

.copy-button:hover {
    background: var(--surface-color);
    border-color: var(--accent-color);
    color: var(--accent-color);
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container { padding: 1rem; }
    h1 { font-size: 2rem; }
    .drop-zone { padding: 2rem 1rem; }
    .url-input { 
        flex-direction: column;
        .button { width: 100%; }
    }
}

@media (max-width: 480px) {
    body { padding: 0.5rem; }
    .container { padding: 0.5rem; }
    h1 { font-size: 1.75rem; }
}

/* Loading animation */
.loading {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}

.loading[hidden] {
    display: none;
}

.result-wrapper[hidden] {
    display: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--text-color);
    font-size: 0.95rem;
    text-align: center;
}

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

.api-docs {
    background: var(--surface-color);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    overflow: hidden;
}

.api-docs.collapsed .api-docs-content {
    display: none;
}

.api-docs.collapsed .toggle-button i {
    transform: rotate(-90deg);
}

.toggle-button {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.toggle-button i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.toggle-button:hover {
    opacity: 1;
    color: var(--accent-color);
}

.api-docs-content {
    transition: all 0.3s ease;
}

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

.api-docs-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.api-docs-content {
    padding: 1.5rem;
}

.api-docs-content p {
    margin: 0 0 1rem 0;
    color: #94a3b8;
}

.api-docs pre {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.api-docs code {
    color: var(--text-color);
}
  