:root {
    /* Light Theme (Default) */
    --sync-bg: #f8fafc;
    --sync-blue: #2563eb;
    --sync-blue-glow: rgba(37, 99, 235, 0.1);
    --sync-emerald: #059669;
    --sync-card-bg: rgba(255, 255, 255, 0.7);
    --sync-card-border: rgba(0, 0, 0, 0.06);
    --sync-text: #0f172a;
    --sync-text-muted: #64748b;
    --sync-glow-opacity: 0.08;
    
    /* Solid Box Theme */
    --sync-box-bg: #ffffff;
    --sync-box-border: #94a3b8;
    --sync-icon-bg: var(--sync-blue);
}

.dark {
    /* Dark Theme Overrides */
    --sync-bg: #050a15;
    --sync-blue: #3b82f6;
    --sync-blue-glow: rgba(59, 130, 246, 0.15);
    --sync-emerald: #10b981;
    --sync-card-bg: rgba(15, 23, 42, 0.6);
    --sync-card-border: rgba(255, 255, 255, 0.08);
    --sync-text: #f1f5f9;
    --sync-text-muted: #94a3b8;
    --sync-glow-opacity: 0.15;
}

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

body {
    background-color: var(--sync-bg);
    color: var(--sync-text);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

::selection {
    background: var(--sync-blue);
    color: white;
}

.dark ::selection {
    background: var(--sync-blue);
    color: #050a15;
}

/* Background Elements */
.glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: var(--sync-glow-opacity);
    z-index: -1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.glow-1 {
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, var(--sync-blue), transparent);
    animation: float 20s ease-in-out infinite;
}

.glow-2 {
    bottom: -150px;
    right: -100px;
    background: radial-gradient(circle, var(--sync-emerald), transparent);
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, 60px); }
}

/* Glassmorphism */
.glass-card {
    background: var(--sync-card-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--sync-card-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    transition: background 0.5s ease, border-color 0.5s ease;
}

.dark .glass-card {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

/* Navigation */
.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sync-text-muted);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--sync-text);
    background: rgba(125, 125, 125, 0.05);
}

.nav-link.active {
    color: var(--sync-blue);
    background: rgba(59, 130, 246, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: var(--sync-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--sync-blue);
}

/* Bottom Nav (Mobile) */
.mobile-nav {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 400px;
    background: var(--sync-card-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--sync-card-border);
    border-radius: 24px;
    display: flex;
    justify-content: space-around;
    padding: 12px;
    z-index: 50;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.dark .mobile-nav {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--sync-text-muted);
    transition: all 0.3s ease;
    cursor: pointer;
}

.mobile-nav-item.active {
    color: var(--sync-blue);
}

/* Buttons */
.btn-gradient {
    background: linear-gradient(135deg, var(--sync-blue), #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
    filter: brightness(1.1);
}

.btn-gradient:active {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Utility Interactions */
button:active:not(.nav-link), .mobile-nav-item:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Icon Box */
.icon-box {
    background: var(--sync-icon-bg);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 0.5rem;
    box-shadow: 0 0 20px var(--sync-blue-glow);
}

.dark .icon-box {
    background: rgba(125, 125, 125, 0.1);
    color: var(--sync-blue);
}

/* Badges */
.badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(125, 125, 125, 0.05);
    border: 1px solid var(--sync-card-border);
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--sync-text-muted);
}

/* File Items */
.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(125, 125, 125, 0.03);
    border: 1px solid var(--sync-card-border);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: rgba(125, 125, 125, 0.06);
}

/* Inputs */
textarea, input {
    background: var(--sync-box-bg) !important;
    border: 1px solid var(--sync-box-border) !important;
    color: var(--sync-text) !important;
    transition: all 0.3s ease;
}

.dark textarea, .dark input {
    background: rgba(125, 125, 125, 0.05) !important;
    border: 1px solid var(--sync-card-border) !important;
    color: white !important;
}

textarea:focus, input:focus {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

#drop-zone {
    background: #acb0b9 !important;
    border-color: var(--sync-box-border) !important;
}

.dark #drop-zone {
    background: rgba(15, 23, 42, 0.2) !important;
    border-color: var(--sync-card-border) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--sync-card-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--sync-text-muted);
}

/* Entrance Animations */
@keyframes viewEntrance {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.view-section.active {
    animation: viewEntrance 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Focus States */
:focus-visible {
    outline: 2px solid var(--sync-blue);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Loader */
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    border-top-color: var(--sync-blue);
    animation: spin 1s ease-in-out infinite;
}

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

/* Modal Backdrop Blur */
#view-crop {
    backdrop-filter: blur(20px);
}

/* Code Display */
#sync-code-container .code-box {
    width: 60px;
    height: 80px;
    background: var(--sync-card-bg);
    border: 2px solid var(--sync-blue);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--sync-text);
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.dark #sync-code-container .code-box {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    .glass-card {
        padding: 1.5rem !important;
    }
    
    #sync-code-container .code-box {
        width: 45px;
        height: 65px;
        font-size: 1.5rem;
    }

    body {
        padding-bottom: 100px;
    }
}

.text-slate-200 {
    border-radius: 0.5rem;
    padding: 1rem;
}

/* Utility Tools Styling */
.hover-scale {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-scale:hover {
    transform: scale(1.02);
}

.glass-utility {
    background: rgba(125, 125, 125, 0.03);
    border: 1px solid var(--sync-card-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.text-sync-blue {
    color: var(--sync-blue) !important;
}

.text-sync-emerald {
    color: var(--sync-emerald) !important;
}

[data-theme-primary] {
    color: var(--sync-blue);
}