:root {
    --primary: #0066cc;
    --primary-hover: #0056b3;
    --secondary: #5e5e60;
    --bg-dark: #f5f5f7;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-highlight: rgba(0, 0, 0, 0.03);
    --danger: #ff3b30;
    --success: #34c759;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #0a84ff;
        --primary-hover: #0070e0;
        --secondary: #98989d;
        --bg-dark: #000000;
        --text-main: #f5f5f7;
        --text-muted: #86868b;
        --glass-bg: rgba(30, 30, 30, 0.75);
        --glass-border: rgba(255, 255, 255, 0.1);
        --glass-highlight: rgba(255, 255, 255, 0.05);
        --danger: #ff453a;
        --success: #32d74b;
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.glass-panel-strong {
    background: var(--glass-bg);
    backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo h1 {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.home-link {
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.home-link:hover {
    background: rgba(0, 0, 0, 0.1);
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.card {
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 500px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 600;
}

.modern-select {
    width: 100%;
    background: var(--bg-dark);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.modern-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.file-drop-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    border: 2px dashed var(--glass-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
    transition: all 0.2s;
    cursor: pointer;
    text-align: center;
}

.file-drop-area:hover,
.file-drop-area.dragover {
    border-color: var(--primary);
    background: rgba(0, 102, 204, 0.05);
}

.file-drop-area input[type=file] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-message {
    font-size: 0.95rem;
    color: var(--text-main);
}

.file-message strong {
    color: var(--primary);
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.primary-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--secondary);
}

.full-width {
    width: 100%;
}

/* Utilities */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideIn 0.3s forwards;
}

.toast.error i {
    color: var(--danger);
}

.toast.success i {
    color: var(--success);
}

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

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