html { scroll-behavior: smooth !important; }

:root {
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --bg-color: #070b14;
    --text-color: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --menu-bg: rgba(7, 11, 20, 0.98);
    --active-link: #6366f1;
    --scroll-track: #0a0f1d;
    --scroll-thumb: #1e293b;
    --scroll-thumb-hover: #6366f1;
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.light-mode {
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --glass-bg: rgba(15, 23, 42, 0.05);
    --glass-border: rgba(15, 23, 42, 0.1);
    --menu-bg: rgba(248, 250, 252, 0.98);
    --active-link: #4f46e5;
    --scroll-track: #f1f5f9;
    --scroll-thumb: #cbd5e1;
    --scroll-thumb-hover: #4f46e5;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--scroll-track); }
::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 20px;
    border: 2px solid var(--scroll-track);
    transition: all 0.3s;
}
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
}

.nav-link.active {
    color: var(--active-link);
    font-weight: 800;
    border-bottom: 2px solid var(--active-link);
    text-shadow: 0 0 15px var(--active-link);
}

.mobile-link.active {
    color: var(--active-link);
    transform: scale(1.1);
    letter-spacing: 0.1em;
}

.color-card {
    min-height: 550px; 
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1);
    user-select: none;
    -webkit-user-select: none;
    position: relative;
}

.color-card:hover {
    transform: translateY(-15px) scale(1.03);
    z-index: 10;
}

@media (max-width: 768px) {
    #palette-container { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
    #palette-container > div:nth-child(-n+3) { width: calc(33.33% - 7px); min-height: 280px; padding: 1rem !important; }
    #palette-container > div:nth-child(n+4) { width: calc(50% - 5px); min-height: 280px; padding: 1.5rem !important; }
    .color-card span { font-size: 0.65rem !important; }
}

.color-card:hover .copy-btn { opacity: 1; }

.gradient-text {
    background: linear-gradient(to right, #6366f1, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 55px;
    height: 55px;
    cursor: pointer;
    background: transparent;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 2px solid rgba(255,255,255,0.2); border-radius: 50%; }

.hex-input-field {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    font-family: monospace;
    font-size: 10px;
    text-align: center;
    width: 70px;
    padding: 4px 0;
    border-radius: 8px;
    margin-top: 8px;
    outline: none;
    text-transform: uppercase;
}
.light-mode .hex-input-field {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
    color: #0f172a;
}

#mobile-menu {
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(100%);
    background: var(--menu-bg);
    backdrop-filter: blur(30px);
    position: fixed;
    right: 0;
    top: 0;
    width: 80%;
    height: 100vh;
    z-index: 200;
    box-shadow: -10px 0 30px rgba(0,0,0,0.2);
}
.menu-open { transform: translateX(0) !important; }

#install-btn {
    position: fixed; z-index: 150; bottom: 20px; left: 50%; transform: translateX(-50%);
    display: none; background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    padding: 8px 18px; border-radius: 50px; animation: pulse-glow 2.5s infinite ease-in-out;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

@keyframes pulse-glow {
    0% { transform: translateX(-50%) scale(1); opacity: 0.9; }
    50% { transform: translateX(-50%) scale(1.05); opacity: 1; }
    100% { transform: translateX(-50%) scale(1); opacity: 0.9; }
}

#back-to-section-btn { position: fixed; z-index: 150; bottom: 30px; right: 30px; display: none; }

.preview-box { transition: all 0.5s ease; border: 1px solid var(--glass-border); }

/* Modified Sample UI - Full Website Preview */
.sample-ui-card { 
    width: 100%; 
    height: 600px; 
    border-radius: 40px; 
    overflow: hidden; 
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); 
    display: flex;
    flex-direction: column;
    position: relative;
}
.ui-navbar { padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; }
.ui-nav-links { display: flex; gap: 20px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.ui-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 40px; }
.ui-services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; padding: 20px 40px; }
.ui-service-item { padding: 15px; border-radius: 20px; text-align: center; }

.lock-indicator { position: absolute; top: 25px; right: 25px; font-size: 1.2rem; transition: 0.3s; opacity: 0.3; }
.lock-indicator.locked { opacity: 1; color: #6366f1; transform: scale(1.2); }

.contrast-score { position: absolute; top: 25px; left: 25px; font-size: 0.7rem; font-weight: 800; padding: 4px 8px; border-radius: 8px; background: rgba(0,0,0,0.2); }

#history-panel {
    position: fixed; left: -320px; top: 0; width: 300px; height: 100vh; 
    background: var(--menu-bg); z-index: 300; transition: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 100px 20px; border-right: 1px solid var(--glass-border);
}
#history-panel.open { left: 0; }
.history-item { display: flex; height: 40px; border-radius: 10px; overflow: hidden; margin-bottom: 12px; cursor: pointer; border: 1px solid rgba(255,255,255,0.05); }

.presentation-active { overflow: hidden !important; }
.presentation-overlay { 
    position: fixed; inset: 0; z-index: 9999; display: none; 
    background: #000; flex-direction: row; 
}
.cb-protanopia { filter: url('#protanopia'); }
.cb-deuteranopia { filter: url('#deuteranopia'); }

.favorite-btn { position: absolute; top: 70px; right: 25px; font-size: 1.1rem; transition: 0.3s; opacity: 0.3; cursor: pointer; }
.favorite-btn.active { opacity: 1; color: #ec4899; }
.wcag-badge { font-size: 0.6rem; padding: 2px 5px; border-radius: 4px; margin-left: 5px; }
.wcag-pass { background: #10b981; color: white; }
.wcag-fail { background: #ef4444; color: white; }

.viewer-container {
    width: 100%;
    background: var(--glass-bg);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: var(--transition);
}
#canvas-wrapper { position: relative; cursor: crosshair; display: none; max-width: 100%; }
canvas#precision-canvas { display: block; max-width: 100%; max-height: 70vh; border-radius: 8px; }
#magnifier {
    position: fixed; width: 130px; height: 130px; border: 4px solid white;
    border-radius: 50%; pointer-events: none; display: none; z-index: 9999;
    box-shadow: 0 0 25px rgba(0,0,0,0.4); background-repeat: no-repeat; image-rendering: pixelated;
}
.precision-upload-btn {
    background: var(--accent);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    color: white;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}
.precision-upload-btn:hover { transform: translateY(-3px); filter: brightness(1.1); }