:root {
    --ios-bg: #1c1c1e;
    --ios-card: #2c2c2e;
    --ios-text: #ffffff;
    --ios-text-secondary: #8e8e93;
    --ios-primary: #0a84ff;
    --ios-success: #30d158;
    --ios-error: #ff453a;
    --ios-blur: rgba(28, 28, 30, 0.8);
    --ios-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    --radius: 20px;
}

[data-theme="light"] {
    --ios-bg: #f2f2f7;
    --ios-card: #ffffff;
    --ios-text: #000000;
    --ios-text-secondary: #8e8e93;
    --ios-primary: #007aff;
    --ios-success: #34c759;
    --ios-error: #ff3b30;
    --ios-blur: rgba(255, 255, 255, 0.8);
    --ios-border: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--ios-bg);
    color: var(--ios-text);
    line-height: 1.4;
    overflow-x: hidden;
    transition: background 0.3s ease;
}

/* Nav Bar */
.ios-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 60px;
}

.nav-blur {
    position: absolute;
    inset: 0;
    background: var(--ios-blur);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 0.5px solid var(--ios-border);
}

.nav-content {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--ios-primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--ios-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.icon-btn:active {
    background: var(--ios-border);
}

/* Main */
.ios-main {
    padding: 80px 16px 40px;
    max-width: 800px;
    margin: 0 auto;
}

.hero-section {
    text-align: center;
    margin-bottom: 30px;
}

.hero-section h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.hero-section p {
    color: var(--ios-text-secondary);
    font-size: 16px;
    font-weight: 500;
    max-width: 280px;
    margin: 0 auto;
}

/* Cards */
.ios-card {
    background: var(--ios-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

/* Upload Zone Advanced */
.upload-zone {
    border: 2px dashed var(--ios-border);
    border-radius: 20px;
    padding: 40px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, var(--ios-card), var(--ios-bg));
    margin-bottom: 16px;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--ios-primary) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.upload-zone:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--ios-primary);
    box-shadow: 0 20px 40px rgba(0, 122, 255, 0.1);
}

.upload-zone:hover::before {
    opacity: 0.05;
}

.upload-icon-wrapper {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--ios-primary), #5856d6);
    color: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
    box-shadow: 0 10px 20px rgba(0, 122, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.upload-zone:hover .upload-icon-wrapper {
    transform: rotate(10deg) scale(1.1);
}

.upload-zone h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(to right, var(--ios-text), var(--ios-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.upload-zone p {
    color: var(--ios-text-secondary);
    font-size: 14px;
    margin-bottom: 0;
}

.file-list {
    margin-top: 15px;
    margin-bottom: 15px;
}

/* Results section spacing */
.results-section {
    margin-top: 25px;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.results-header h2 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-header i {
    color: var(--ios-success);
    font-size: 22px;
}

.result-card {
    padding: 16px;
    background: var(--ios-bg);
    border-radius: 16px;
    margin-bottom: 12px;
}

.result-url {
    word-break: break-all;
    font-family: monospace;
    font-size: 12px;
}

/* Buttons */
.ios-btn {
    width: 100%;
    border-radius: 14px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.primary-btn {
    background: var(--ios-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.primary-btn:active {
    opacity: 0.8;
}

.primary-btn:disabled {
    background: var(--ios-border);
    color: var(--ios-text-secondary);
    cursor: not-allowed;
}

.secondary-btn {
    background: var(--ios-border);
    color: var(--ios-primary);
}

/* File List */
.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 0.5px solid var(--ios-border);
}

.file-item:last-child {
    border-bottom: none;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    font-size: 15px;
}

.file-size {
    font-size: 13px;
    color: var(--ios-text-secondary);
}

.file-remove {
    color: var(--ios-error);
    background: none;
    border: none;
    font-size: 18px;
    padding: 8px;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 40px;
}

.feature-item {
    text-align: center;
}

.feature-item i {
    font-size: 28px;
    color: var(--ios-primary);
    margin-bottom: 12px;
}

.feature-item h3 {
    font-size: 17px;
    margin-bottom: 6px;
}

.feature-item p {
    font-size: 14px;
    color: var(--ios-text-secondary);
}

/* Animations */
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.animate-slide-up {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-text { animation: fadeIn 0.8s ease forwards; }
.animate-text-delay { animation: fadeIn 0.8s 0.3s ease both; }

/* Overlays */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--ios-blur);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.ios-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--ios-border);
    border-top-color: var(--ios-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

/* Toast */
.ios-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--ios-card);
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 3000;
    transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    font-weight: 600;
    white-space: nowrap;
}

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

/* Footer */
.ios-footer {
    padding: 40px 20px;
    text-align: center;
    color: var(--ios-text-secondary);
    font-size: 14px;
}

.footer-links {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: var(--ios-primary);
    text-decoration: none;
}

/* Responsive */
/* Sidebar */
.ios-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--ios-card);
    z-index: 2000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
}

.ios-sidebar.open {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 1999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.5px solid var(--ios-border);
}

.close-sidebar {
    background: none;
    border: none;
    color: var(--ios-text-secondary);
    font-size: 20px;
    cursor: pointer;
}

.sidebar-nav {
    padding: 20px 10px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--ios-text);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 8px;
    font-weight: 600;
    transition: background 0.2s;
}

.nav-item i {
    width: 20px;
    text-align: center;
    color: var(--ios-primary);
}

.nav-item:hover, .nav-item.active {
    background: rgba(10, 132, 255, 0.1);
    color: var(--ios-primary);
}

.nav-divider {
    height: 0.5px;
    background: var(--ios-border);
    margin: 15px 16px;
}

.theme-item {
    justify-content: space-between;
}

/* Switch */
.ios-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #e9e9eb;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

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

.sidebar-footer {
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--ios-text-secondary);
}

.menu-btn {
    background: none;
    border: none;
    color: var(--ios-primary);
    font-size: 20px;
    cursor: pointer;
    margin-right: 15px;
}

/* API Docs Specific */
.doc-card {
    background: var(--ios-card);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .hero-section h1 { font-size: 32px; }
    .ios-main { padding-top: 80px; }
}