@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;800&display=swap');

:root {
    --bg-dark: 220 20% 8%;
    --bg-panel: 220 25% 12%;
    --text-main: 220 20% 95%;
    --text-muted: 220 15% 65%;
    
    --primary: 250 85% 60%;
    --primary-glow: 250 85% 60%;
    --accent: 320 85% 60%;
    
    /* Colors for notes */
    --c-indigo: 250 70% 50%;
    --c-rose: 340 70% 50%;
    --c-emerald: 150 70% 40%;
    --c-amber: 35 90% 50%;
    --c-purple: 280 70% 50%;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: hsl(var(--bg-dark));
    color: hsl(var(--text-main));
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Glassmorphism Utilities */
.glass {
    background: hsla(var(--bg-panel), 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid hsla(var(--text-main), 0.08);
    box-shadow: 0 8px 32px 0 hsla(0, 0%, 0%, 0.3);
}

.glass-panel {
    background: hsla(var(--bg-panel), 0.8);
    border-radius: 16px;
    border: 1px solid hsla(var(--text-main), 0.05);
}

/* Auth Layout */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, hsla(var(--primary), 0.15), transparent 40%),
                radial-gradient(circle at bottom left, hsla(var(--accent), 0.15), transparent 40%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 3rem;
    border-radius: 24px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-card h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--text-muted));
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: hsla(var(--bg-dark), 0.5);
    border: 1px solid hsla(var(--text-main), 0.1);
    border-radius: 8px;
    color: hsl(var(--text-main));
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsla(var(--primary), 0.2);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
    color: white;
    box-shadow: 0 4px 15px hsla(var(--primary), 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(var(--primary), 0.6);
}

.btn-outline {
    background: transparent;
    border: 1px solid hsla(var(--text-main), 0.2);
    color: hsl(var(--text-main));
}

.btn-outline:hover {
    background: hsla(var(--text-main), 0.05);
}

.error-text {
    color: hsl(0, 80%, 65%);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Dashboard Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    border-right: 1px solid hsla(var(--text-main), 0.08);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem 4rem;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo span {
    background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: hsl(var(--text-muted));
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: hsla(var(--primary), 0.15);
    color: hsl(var(--primary));
}

.user-profile {
    margin-top: auto;
    padding: 16px;
    border-radius: 16px;
    background: hsla(0,0%,100%,0.03);
    border: 1px solid hsla(var(--text-main), 0.05);
}

/* Topbar & Search */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
    width: 400px;
}
.search-box input {
    width: 100%;
    padding: 12px 20px 12px 48px;
    border-radius: 20px;
    background: hsla(var(--bg-panel), 0.6);
    border: 1px solid hsla(var(--text-main), 0.1);
    color: white;
    transition: 0.3s;
}
.search-box input:focus {
    background: hsla(var(--bg-panel), 0.9);
    border-color: hsl(var(--primary));
    box-shadow: 0 0 15px hsla(var(--primary), 0.2);
}
.search-box svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: hsl(var(--text-muted));
}

/* Note Grid */
.note-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.note-card {
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    border: 1px solid transparent;
    animation: fadeIn 0.4s ease forwards;
}

.note-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.note-card.color-indigo { background: hsla(var(--c-indigo), 0.15); border-color: hsla(var(--c-indigo), 0.3); }
.note-card.color-rose { background: hsla(var(--c-rose), 0.15); border-color: hsla(var(--c-rose), 0.3); }
.note-card.color-emerald { background: hsla(var(--c-emerald), 0.15); border-color: hsla(var(--c-emerald), 0.3); }
.note-card.color-amber { background: hsla(var(--c-amber), 0.15); border-color: hsla(var(--c-amber), 0.3); }
.note-card.color-purple { background: hsla(var(--c-purple), 0.15); border-color: hsla(var(--c-purple), 0.3); }

.note-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    padding-right: 2rem;
}

.note-card p {
    color: hsl(var(--text-muted));
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-card.completed h3 {
    text-decoration: line-through;
    opacity: 0.6;
}
.note-card.completed p {
    opacity: 0.6;
}

.pin-btn, .check-btn, .delete-btn {
    position: absolute;
    background: transparent;
    border: none;
    color: hsl(var(--text-muted));
    cursor: pointer;
    transition: 0.2s;
    padding: 4px;
    border-radius: 50%;
}
.pin-btn { top: 1rem; right: 1rem; }
.check-btn { bottom: 1rem; right: 1rem; }
.delete-btn { bottom: 1rem; right: 3rem; opacity: 0; }

.note-card:hover .delete-btn { opacity: 1; }

.pin-btn:hover { color: hsl(var(--primary)); background: hsla(var(--primary), 0.2); }
.pin-btn.active { color: hsl(var(--primary)); }

.check-btn:hover { color: hsl(var(--c-emerald)); background: hsla(var(--c-emerald), 0.2); }
.check-btn.active { color: hsl(var(--c-emerald)); }

.delete-btn:hover { color: hsl(var(--c-rose)); background: hsla(var(--c-rose), 0.2); }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: hsla(0, 0%, 0%, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 100;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    transform: scale(0.9);
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-content input[type="text"] {
    font-size: 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    margin-bottom: 1rem;
}
.modal-content input[type="text"]:focus { outline: none; }

.modal-content textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: hsl(var(--text-main));
    font-family: 'Inter', sans-serif;
    min-height: 200px;
    resize: none;
    font-size: 1rem;
}
.modal-content textarea:focus { outline: none; }

.color-picker {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}
.color-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}
.color-circle.selected { border-color: white; }
.bg-indigo { background: hsl(var(--c-indigo)); }
.bg-rose { background: hsl(var(--c-rose)); }
.bg-emerald { background: hsl(var(--c-emerald)); }
.bg-amber { background: hsl(var(--c-amber)); }
.bg-purple { background: hsl(var(--c-purple)); }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: 0.3s; z-index: 50; }
    .main-content { margin-left: 0; padding: 1rem; }
    .topbar { flex-direction: column; gap: 1rem; }
    .search-box { width: 100%; }
}
