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

:root {
    --accent: #3b82f6;
    --success: #10b981;
    --error: #ef4444;
    --bg: #ffffff;
    --bg-secondary: #f9fafb;
    --text: #111827;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
}

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

.container {
    max-width: 700px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Card */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
    font-weight: 600;
}

.description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Upload Area */
.upload-area {
    border: 1px dashed var(--border);
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
}

.upload-area:hover {
    border-color: var(--accent);
}

.upload-area.drag-over {
    border-color: var(--accent);
    background: #eff6ff;
}

.upload-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.upload-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Switch */
.switch-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.switch-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--accent);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--accent);
}

input:checked+.slider:before {
    transform: translateX(14px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}


#fileInput {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* File Info */
.file-info {
    background: var(--bg-secondary);
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
}

.label {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: var(--bg-secondary);
    overflow: hidden;
    margin-bottom: 0.375rem;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.2s;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    background: var(--bg);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    width: auto;
    padding: 0.5rem 1rem;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

.btn-download {
    max-width: 60px;
}

/* Input Group */
.input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.input-field {
    flex: 1;
    padding: 0.625rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
}

.input-field::placeholder {
    color: var(--text-secondary);
}

/* Alerts */
.alert {
    padding: 0.75rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.alert strong {
    display: block;
    margin-bottom: 0.25rem;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid var(--success);
    color: #065f46;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid var(--error);
    color: #991b1b;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid var(--accent);
    color: #1e40af;
}

/* Blob URL Display */
.blob-url {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    word-break: break-all;
    font-size: 0.875rem;
}

.blob-url a {
    color: var(--accent);
    text-decoration: none;
}

.blob-url a:hover {
    text-decoration: underline;
}

/* Download Link */
.file-download {
    margin: 0.75rem 0;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.download-link:hover {
    background: #2563eb;
}

.download-link svg {
    width: 1rem;
    height: 1rem;
}

.warning-text {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Info Section */
.info-section {
    margin-top: 2rem;
}

.info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1rem;
}

.info-card h3 {
    color: var(--text);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.info-card ol {
    padding-left: 1.25rem;
}

.info-card li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.info-card strong {
    color: var(--text);
}

/* Responsive */
@media (max-width: 640px) {
    .header h1 {
        font-size: 1.25rem;
    }

    .card {
        padding: 1rem;
    }

    .input-group {
        flex-direction: column;
    }

    .btn-secondary {
        width: 100%;
    }
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    margin-bottom: 0;
}

.section-header .btn {
    width: auto;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.section-header svg {
    width: 1rem;
    height: 1rem;
}

/* Files List - Grid Layout */
.files-list {
    min-height: 150px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 1.5rem;
    font-size: 0.875rem;
    grid-column: 1 / -1;
}

/* File Card */
.file-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
}

.file-card:hover {
    border-color: var(--accent);
}

.file-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.file-card-info {
    flex: 1;
    min-width: 0;
}

.file-card-info h3 {
    font-size: 0.875rem;
    color: var(--text);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.file-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.125rem 0 0 0;
}

.file-card-actions {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    width: auto;
}

.btn-sm svg {
    width: 0.875rem;
    height: 0.875rem;
}

.btn-danger {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.btn-danger:hover {
    background: #dc2626;
}

/* API List */
.api-list {
    list-style: none;
    padding: 0;
}

.api-list li {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    font-family: monospace;
    font-size: 0.8125rem;
}

.api-list li:last-child {
    border-bottom: none;
}

.api-list strong {
    display: inline-block;
    min-width: 60px;
    color: var(--accent);
}

/* OR Divider */
.or-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.or-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.or-divider span {
    position: relative;
    background: var(--bg);
    padding: 0 1rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Copy Notification */
.copy-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--success);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.copy-notification.fade-out {
    animation: slideOut 0.3s ease-out;
    opacity: 0;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}