/* ========================================
   FileDrop - Theme Styles
   Supports Light/Dark theme switching
   ======================================== */

:root {
    /* Light Theme (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-glass: rgba(0, 0, 0, 0.02);
    --bg-glass-border: rgba(0, 0, 0, 0.08);

    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;

    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;
    --border-hover: #3b82f6;

    --gradient-start: #f9fafb;
    --gradient-end: #f3f4f6;

    --shadow-sm: rgba(0, 0, 0, 0.05);
    --shadow-md: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);

    --accent-blue: #3b82f6;
    --accent-purple: #9333ea;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-tertiary: #27272a;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-border: rgba(255, 255, 255, 0.1);

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;

    --border-primary: #27272a;
    --border-secondary: #3f3f46;
    --border-hover: #3b82f6;

    --gradient-start: #18181b;
    --gradient-end: #09090b;

    --shadow-sm: rgba(0, 0, 0, 0.3);
    --shadow-md: rgba(0, 0, 0, 0.5);
    --shadow-lg: rgba(0, 0, 0, 0.7);

    --accent-blue: #60a5fa;
    --accent-purple: #a855f7;
    --accent-green: #34d399;
    --accent-yellow: #fbbf24;
}

* {
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.font-mono {
    font-family: 'Geist Mono', monospace;
}

body {
    background: linear-gradient(to bottom right, var(--gradient-start), var(--gradient-end));
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--bg-glass-border);
    transition: all 0.3s ease;
}

.gradient-border {
    position: relative;
    background: var(--bg-secondary);
    transition: background 0.3s ease;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.5), rgba(147, 51, 234, 0.5));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    /* 关键修复：让伪元素不阻挡点击事件 */
}

.mode-btn {
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.tab-btn {
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-blue);
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--bg-glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(20deg);
}

/* Modal and Overlay Styles */
.modal-overlay {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Form Input Styles */
input[type="text"],
input[type="number"],
select,
textarea {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-secondary);
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[type="text"]::placeholder,
input[type="number"]::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
}

/* Select dropdown arrow color */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23a1a1aa' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
}

/* Label Styles */
label {
    color: var(--text-secondary);
}

/* Checkbox Styles */
input[type="checkbox"] {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    cursor: pointer;
}

input[type="checkbox"]:checked {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Button Styles */
button {
    transition: all 0.3s ease;
}

/* Close button in modal */
.close-btn {
    color: var(--text-secondary);
}

.close-btn:hover {
    color: var(--text-primary);
}

/* Smooth transitions for theme changes */
* {
    transition-property: background-color, border-color, color;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* Background Utilities */
.bg-primary {
    background-color: var(--bg-primary);
}

.bg-secondary {
    background-color: var(--bg-secondary);
}

.bg-tertiary {
    background-color: var(--bg-tertiary);
}

/* Text Utilities */
.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-tertiary {
    color: var(--text-tertiary);
}

/* Border Utilities */
.border-secondary {
    border-color: var(--border-secondary);
}

/* Override for animations that shouldn't transition */
.animate-pulse,
[class*="transition-all"],
[class*="duration-"] {
    transition-property: all !important;
}