/* --- Luxury Glassmorphism Theme (Apple/VisionOS Inspired) --- */
:root {
    /* Deep, rich dark colors for luxury feel */
    --bg-base: #020617; /* Very dark slate */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Elegant accent colors */
    --primary-color: #818cf8; /* Soft indigo */
    --primary-hover: #6366f1;
    --accent-color: #fb7185; /* Soft rose */
    --warning-color: #fbbf24;
    
    /* Glass settings */
    --glass-bg: rgba(15, 23, 42, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    
    /* Fonts */
    --font-main: 'Outfit', sans-serif;
    --font-code: 'Fira Code', monospace;
    --input-bg: rgba(0, 0, 0, 0.2);
}

body.light-mode {
    --bg-base: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --accent-color: #e11d48;
    --warning-color: #d97706;
    
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 1);
    --glass-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.08);
    
    --input-bg: rgba(255, 255, 255, 0.8);
}

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

body {
    font-family: var(--font-main);
    background: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    transition: background 0.5s ease;
}

/* Ambient Mesh Background */
.ambient-mesh {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-base);
    transition: background 0.5s ease;
}

.mesh-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.6;
    animation: float-blob 20s infinite alternate ease-in-out;
}

.blob-1 { width: 60vw; height: 60vw; background: #4c1d95; top: -10%; left: -10%; }
.blob-2 { width: 50vw; height: 50vw; background: #1e3a8a; bottom: -20%; right: -10%; animation-delay: -5s; }
.blob-3 { width: 40vw; height: 40vw; background: #831843; top: 40%; left: 30%; animation-delay: -10s; }
.blob-4 { width: 30vw; height: 30vw; background: #064e3b; bottom: 10%; left: 10%; animation-delay: -15s; }

body.light-mode .mesh-blob { opacity: 0.4; filter: blur(100px); }
body.light-mode .blob-1 { background: #ddd6fe; }
body.light-mode .blob-2 { background: #bfdbfe; }
body.light-mode .blob-3 { background: #fbcfe8; }
body.light-mode .blob-4 { background: #a7f3d0; }

@keyframes float-blob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 10%) scale(1.1); }
}

/* Glass Panel Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all 0.5s ease;
}

/* Layout */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    padding: 24px;
    gap: 24px;
}

/* Sidebar */
.sidebar {
    width: 84px;
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    padding: 30px 0;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.5s ease;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}
.sidebar:hover {
    width: 280px;
}
.sidebar-header {
    padding: 0 24px 30px;
    border-bottom: 1px solid var(--glass-border);
}
.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 22px;
    font-weight: 600;
}
.logo span {
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.sidebar:hover .logo span {
    opacity: 1; visibility: visible;
    transition-delay: 0.1s;
}
.logo i {
    font-size: 36px;
    min-width: 36px;
    background: linear-gradient(135deg, #818cf8, #fb7185);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-menu {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: 20px;
    transition: all 0.3s ease;
}
.nav-link span {
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.sidebar:hover .nav-link span {
    opacity: 1; visibility: visible;
    transition-delay: 0.1s;
}
.nav-link i {
    font-size: 24px; min-width: 24px; text-align: center;
}
.nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
}
body.light-mode .nav-link:hover {
    background: rgba(0,0,0,0.04);
}
.nav-link.active {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
body.light-mode .nav-link.active {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    color: var(--primary-color);
}
.sidebar-footer {
    margin-top: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}
.sidebar:hover .sidebar-footer {
    flex-direction: row;
    justify-content: center;
}
.btn-icon-footer {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 22px;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
body.light-mode .btn-icon-footer { background: #fff; }
.btn-icon-footer:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}
.btn-icon-footer .lang-text { font-size: 14px; font-weight: 600; }

/* Main Content */
.main-content {
    flex: 1;
    position: relative;
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    container-type: inline-size;
}
.tool-section {
    display: none;
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 40px;
    height: 100%;
}
.tool-section.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    opacity: 1;
    transform: translateY(0) scale(1);
}
.tool-header {
    margin-bottom: 40px;
}
.tool-header h2 {
    font-size: 40px;
    font-weight: 300;
    color: var(--text-main);
    letter-spacing: -1px;
    margin-bottom: 8px;
}
.tool-header p {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 400;
}
.tool-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}
/* Inputs */
.input-group { margin-bottom: 24px; }
.input-group label {
    display: block; margin-bottom: 12px; color: var(--text-muted); font-weight: 500; font-size: 14px;
}
textarea, input[type="text"], input[type="number"] {
    width: 100%; padding: 18px 24px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-main);
    font-family: var(--font-code);
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
    backdrop-filter: blur(20px);
}
textarea:focus, input[type="text"]:focus, input[type="number"]:focus {
    border-color: var(--primary-color);
    background: rgba(255,255,255,0.05);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}
/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
    padding: 16px 32px; border: none; border-radius: 100px; font-weight: 500; font-size: 16px;
    cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--font-main); letter-spacing: 0.5px;
}
.btn-primary {
    background: var(--primary-color); color: #fff;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
}
.btn-primary:hover {
    background: var(--primary-hover); transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.5);
}
.btn-secondary {
    background: rgba(255,255,255,0.05); color: var(--text-main); border: 1px solid var(--glass-border);
}
body.light-mode .btn-secondary { background: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.btn-secondary:hover {
    background: rgba(255,255,255,0.1); transform: translateY(-2px);
}
.btn-danger {
    background: var(--accent-color); color: #fff; box-shadow: 0 10px 25px -5px rgba(225, 29, 72, 0.4);
}
.btn-danger:hover {
    background: #be123c; transform: translateY(-2px);
}

@media (max-width: 900px) {
    .app-container { flex-direction: column; padding: 12px; gap: 12px; }
    .sidebar { width: 100%; border-radius: 24px; padding: 16px; flex-shrink: 0; flex-direction: row; align-items: center; justify-content: space-between; }
    .sidebar:hover { width: 100%; }
    .sidebar-header { padding: 0; border: none; }
    .nav-menu { padding: 0; flex-direction: row; gap: 8px; }
    .nav-link { padding: 12px; border-radius: 16px; }
    .nav-link span { display: none; }
    .sidebar-footer { padding: 0; flex-direction: row; border: none; margin: 0; }
    .tool-section { padding: 20px; }
}
