/* ================================================
   Notas — Sistema Noor
   ================================================ */

:root {
    --primary: #fbbf24; /* Amber/Yellow for Notes */
    --primary-hover: #f59e0b;
    --primary-glow: rgba(245, 158, 11, 0.3);
    --accent: #d97706;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.65);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --input-bg: rgba(15, 23, 42, 0.6);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

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

/* ===== Animated Background ===== */
.background-container {
    position: fixed;
    width: 100vw; height: 100vh;
    z-index: 0; overflow: hidden;
    pointer-events: none;
}
.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    animation: float 20s infinite alternate cubic-bezier(0.5,0,0.5,1);
    opacity: 0.2;
}
.blob-1 { width:500px;height:500px;background:#f59e0b;top:-150px;left:-100px;animation-duration:28s; }
.blob-2 { width:400px;height:400px;background:#ef4444;bottom:-100px;right:-100px;animation-duration:22s;animation-delay:-5s; }
.blob-3 { width:350px;height:350px;background:#3b82f6;top:50%;left:40%;animation-duration:25s;animation-delay:-10s; }
@keyframes float {
    0%{transform:translate(0,0) scale(1)}
    33%{transform:translate(80px,-60px) scale(1.15)}
    66%{transform:translate(-40px,80px) scale(0.95)}
    100%{transform:translate(60px,40px) scale(1.05)}
}

/* ===== Nav ===== */
.top-nav {
    position: sticky; top:0; z-index:100;
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 30px;
    background:rgba(15,23,42,0.8);
    backdrop-filter:blur(16px);
    border-bottom:1px solid var(--border-color);
}
.nav-left { display:flex; align-items:center; gap:12px; }
.nav-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    display: block;
    background: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.75), 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-logo-img:hover {
    transform: scale(1.03);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.9), 0 4px 12px rgba(0, 0, 0, 0.3);
}
.nav-left h2 { font-size:1.15rem;font-weight:700; }
.nav-accent { color:var(--accent);font-weight:400; }
.nav-right { display:flex;align-items:center;gap:20px; }
.nav-user { font-size:0.85rem;color:var(--text-muted);padding:6px 14px;background:rgba(255,255,255,0.05);border-radius:20px; }
.nav-link { display:flex;align-items:center;gap:6px;color:var(--text-muted);text-decoration:none;font-size:0.85rem;font-weight:500;padding:8px 14px;border-radius:var(--radius-sm);transition:all 0.25s; }
.nav-link:hover { background:rgba(255,255,255,0.06);color:var(--text-main); }

/* ===== Main Layout ===== */
.main-content { position:relative;z-index:1;padding:24px 30px;height:calc(100vh - 65px); }

.notes-layout {
    display:grid;
    grid-template-columns: 240px 1fr;
    gap:20px;
    height:100%;
}

/* ===== Glass Card ===== */
.glass-card {
    background:var(--card-bg);
    backdrop-filter:blur(12px);
    border:1px solid var(--border-color);
    border-radius:var(--radius-xl);
    padding:20px;
    transition:border-color 0.3s;
}
.glass-card:hover { border-color:var(--border-hover); }

/* ===== Sidebar ===== */
.sidebar {
    display:flex;flex-direction:column;
    overflow:hidden;
}
.sidebar-header {
    display:flex;align-items:center;justify-content:space-between;
    margin-bottom:16px;
    padding-bottom:12px;
    border-bottom:1px solid var(--border-color);
}
.sidebar-header h3 { font-size:1rem;font-weight:700; }

.folder-list { flex:1;display:flex;flex-direction:column;gap:8px; }

.folder-btn {
    display:flex;align-items:center;gap:12px;
    width:100%;padding:14px;border:none;border-radius:var(--radius-md);
    background:transparent;color:var(--text-muted);
    font-size:0.95rem;font-weight:600;font-family:inherit;
    cursor:pointer;transition:all 0.25s;
    text-align:left;
}
.folder-btn:hover { background:rgba(255,255,255,0.05);color:var(--text-main); }
.folder-btn.active { background:rgba(245, 158, 11, 0.15);color:var(--primary); }

/* ===== Notes Main Area ===== */
.notes-main { display:flex;flex-direction:column;gap:16px;overflow:hidden; }

/* Controls */
.notes-controls {
    display:flex;align-items:center;justify-content:space-between;
    padding:16px 20px;
    flex-shrink:0;
}
.controls-left h2 { font-size:1.2rem;font-weight:700; }
.controls-right { display:flex;align-items:center;gap:12px; }

/* Notes Grid Wrapper */
.notes-grid-wrapper {
    flex:1;overflow-y:auto;padding:20px;
}
.notes-grid-wrapper::-webkit-scrollbar { width:6px; }
.notes-grid-wrapper::-webkit-scrollbar-track { background:transparent; }
.notes-grid-wrapper::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.1);border-radius:4px; }

.empty-state {
    text-align:center;padding:80px 20px;color:var(--text-dim);
    display:flex;flex-direction:column;align-items:center;justify-content:center;
    height:100%;
}
.empty-state p { margin-top:16px;font-size:0.95rem; }

.notes-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
    gap:20px;
    align-items: start;
}

/* Note Card */
.note-card {
    background:rgba(255,255,255,0.03);
    border:1px solid var(--border-color);
    border-radius:var(--radius-md);
    padding:20px;
    cursor:pointer;
    transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position:relative;
    display:flex;flex-direction:column;gap:10px;
    max-height:300px;
}

.note-card:hover {
    background:rgba(255,255,255,0.06);
    border-color:var(--primary);
    transform:translateY(-4px);
    box-shadow:0 12px 24px rgba(0,0,0,0.2);
}

.note-header {
    display:flex;justify-content:space-between;align-items:flex-start;gap:10px;
}
.note-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-content-preview {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    flex: 1;
}

.note-footer {
    display:flex;justify-content:space-between;align-items:center;
    margin-top:auto;padding-top:12px;border-top:1px solid rgba(255,255,255,0.05);
}
.note-date { font-size:0.75rem;color:var(--text-dim); }
.note-owner { font-size:0.75rem;font-weight:600;color:var(--primary); background:rgba(245,158,11,0.1); padding:2px 6px; border-radius:4px; }

.note-actions {
    display:flex;gap:8px;
    opacity:0;transition:opacity 0.2s;
}
.note-card:hover .note-actions { opacity:1; }

.note-action-btn {
    background:transparent;border:none;color:var(--text-dim);
    cursor:pointer;padding:4px;border-radius:4px;
    transition:all 0.2s;
}
.note-action-btn:hover { background:rgba(255,255,255,0.1);color:var(--text-main); }
.note-action-btn.pin-active-note { color:#fbbf24; opacity:1 !important; }
.note-card:has(.pin-active-note) .note-actions { opacity:1; }

/* ===== Buttons ===== */
.btn {
    display:inline-flex;align-items:center;justify-content:center;gap:8px;
    padding:12px 22px;border-radius:var(--radius-md);
    font-size:0.9rem;font-weight:600;border:none;cursor:pointer;
    transition:all 0.3s;font-family:inherit;white-space:nowrap;
}
.primary-btn { background:var(--primary);color:#0f172a;box-shadow:0 4px 15px var(--primary-glow); }
.primary-btn:hover { background:var(--primary-hover);transform:translateY(-2px); }
.outline-btn { background:transparent;color:var(--text-main);border:1px solid var(--border-color); }
.outline-btn:hover { background:rgba(255,255,255,0.05); }
.danger-btn { background:var(--danger);color:white; }
.danger-btn:hover { background:var(--danger-hover); }
.small-btn { padding:8px 14px;font-size:0.8rem;border-radius:var(--radius-sm); }
.accent-btn { background:rgba(245,158,11,0.12);color:var(--primary);border:1px solid rgba(245,158,11,0.2); }
.accent-btn:hover { background:rgba(245,158,11,0.2); }

/* ===== Modals ===== */
.modal-overlay {
    position:fixed;inset:0;
    background:rgba(0,0,0,0.6);
    backdrop-filter:blur(4px);
    z-index:200;
    display:none;
    align-items:center;justify-content:center;
    animation:fadeInOverlay 0.25s;
}
.modal-overlay.open { display:flex; }

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

.modal {
    width:90%;max-width:550px;
    padding:28px;
    animation:modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity:0;transform:translateY(20px) scale(0.95); }
    to { opacity:1;transform:translateY(0) scale(1); }
}

.modal-header {
    display:flex;align-items:center;justify-content:space-between;
    margin-bottom:24px;
}
.modal-header h3 { font-size:1.15rem;font-weight:700; }

.modal-close {
    width:36px;height:36px;border-radius:var(--radius-sm);
    border:1px solid var(--border-color);background:transparent;
    color:var(--text-muted);cursor:pointer;
    display:flex;align-items:center;justify-content:center;
    transition:all 0.25s;
}
.modal-close:hover { background:rgba(255,255,255,0.05);color:var(--text-main); }

.modal-actions {
    display:flex;gap:10px;justify-content:flex-end;margin-top:20px;
}

/* ===== Form elements ===== */
.input-group { margin-bottom:16px; }
.input-group label {
    display:block;font-size:0.78rem;font-weight:600;
    margin-bottom:6px;color:var(--text-muted);
    text-transform:uppercase;letter-spacing:0.5px;
}
.input-group input,
.input-group textarea,
.input-group select {
    width:100%;padding:12px 14px;
    background:var(--input-bg);border:1px solid var(--border-color);
    border-radius:var(--radius-md);color:var(--text-main);
    font-size:0.9rem;font-family:inherit;
    transition:all 0.3s;outline:none;
}
.input-group textarea { resize:vertical;min-height:100px; }
.input-group input:focus,
.input-group textarea:focus {
    border-color:var(--primary);
    box-shadow:0 0 0 3px rgba(245,158,11,0.15);
}
.input-group input::placeholder,
.input-group textarea::placeholder { color:var(--text-dim); }

.form-row { display:grid;grid-template-columns:1fr 1fr;gap:14px; }

/* Messages */
.message {
    font-size:0.85rem;margin-top:10px;
    padding:12px 16px;border-radius:var(--radius-md);
    display:none;text-align:center;
}
.error-message { background:rgba(239,68,68,0.1);color:#fca5a5;border:1px solid rgba(239,68,68,0.2); }
.success-message { background:rgba(34,197,94,0.1);color:#86efac;border:1px solid rgba(34,197,94,0.2); }

.shared-users-list {
    margin-top: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-md);
    padding: 1rem;
}
.shared-user-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem 0; border-bottom: 1px solid var(--border-color);
}
.shared-user-item:last-child { border-bottom: none; }
.shared-user-info { font-size: 0.9rem; }
.shared-user-email { font-size: 0.75rem; color: var(--text-dim); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .notes-layout { grid-template-columns:1fr;height:auto; }
    .sidebar { max-height:200px; }
    .main-content { height:auto;padding:16px; }
}

@media (max-width: 640px) {
    .notes-controls { flex-direction:column;gap:12px;align-items:stretch; }
    .controls-right { justify-content:space-between; }
    .form-row { grid-template-columns:1fr; }
    .top-nav { padding:12px 16px; }
    .nav-user { display:none; }
}
