/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px;
}

/* Wrapper */
.wrapper {
    width: 95%;
    max-width: 1200px;
    margin: auto;
}

/* Header */
.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    letter-spacing: -0.5px;
}

.header p {
    opacity: 0.9;
    margin-top: 8px;
    font-weight: 300;
}

/* NOTE TRIGGER - Google Keep Style */
.note-trigger {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 40px;
    padding: 16px 20px;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    color: #5f6368;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.note-trigger:hover {
    box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

.note-trigger span {
    font-size: 1.2rem;
    margin-right: 10px;
}

/* GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ENTRY CARD - Modern Card Design */
.entry {
    background: white;
    padding: 20px;
    border-radius: 12px;
    color: #202124;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.entry::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.entry:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.entry:hover::before {
    opacity: 1;
}

.entry h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #202124;
    word-break: break-word;
}

.entry p {
    font-size: 0.9rem;
    color: #5f6368;
    line-height: 1.5;
    margin-bottom: 50px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* DELETE BUTTON - Floating Action */
.delete-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: #f1f3f4;
    border: none;
    padding: 8px 16px;
    color: #5f6368;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.delete-btn:hover {
    background: #fce8e6;
    color: #c5221f;
}

.delete-btn svg {
    width: 16px;
    height: 16px;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: white;
    padding: 60px 20px;
    opacity: 0.8;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.95rem;
}

/* MODAL - Glassmorphism Design */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.modal.active {
    display: flex;
}

/* MODAL BOX */
.modal-content {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.modal-header {
    padding: 20px 24px 0;
    border-bottom: none;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #202124;
}

/* INPUT CONTAINER */
.input-container {
    padding: 16px 24px;
}

/* INPUT */
.modal-content input {
    width: 100%;
    padding: 12px 0;
    margin-bottom: 8px;
    border: none;
    outline: none;
    font-size: 16px;
    color: #202124;
    font-weight: 500;
    border-bottom: 1px solid #e0e0e0;
    transition: border-color 0.2s ease;
}

.modal-content input:focus {
    border-bottom-color: #667eea;
}

.modal-content input::placeholder {
    color: #9aa0a6;
    font-weight: 400;
}

/* TEXTAREA */
.modal-content textarea {
    width: 100%;
    padding: 12px 0;
    border: none;
    outline: none;
    font-size: 14px;
    color: #202124;
    line-height: 1.5;
    resize: none;
    min-height: 100px;
    border-bottom: 1px solid #e0e0e0;
    transition: border-color 0.2s ease;
}

.modal-content textarea:focus {
    border-bottom-color: #667eea;
}

.modal-content textarea::placeholder {
    color: #9aa0a6;
}

/* ACTION BUTTONS */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 24px;
}

/* BUTTON STYLE */
.modal-actions button {
    padding: 10px 24px;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

/* ADD BUTTON */
.modal-actions button:first-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-actions button:first-child:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* CLOSE BUTTON */
.modal-actions button:last-child {
    background: #f1f3f4;
    color: #5f6368;
}

.modal-actions button:last-child:hover {
    background: #e8eaed;
    color: #202124;
}

/* Floating Action Button (alternative to note trigger) */
.fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
}

.fab svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Hide FAB on larger screens, show note trigger */
@media (min-width: 768px) {
    .fab {
        display: none;
    }
}

@media (max-width: 767px) {
    .note-trigger {
        display: none;
    }
    .fab {
        display: flex;
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .modal-content {
        border-radius: 12px;
    }
}

/* Animation for entries */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.entry {
    animation: fadeInUp 0.4s ease;
    animation-fill-mode: both;
}

.entry:nth-child(1) { animation-delay: 0.05s; }
.entry:nth-child(2) { animation-delay: 0.1s; }
.entry:nth-child(3) { animation-delay: 0.15s; }
.entry:nth-child(4) { animation-delay: 0.2s; }
.entry:nth-child(5) { animation-delay: 0.25s; }
.entry:nth-child(6) { animation-delay: 0.3s; }/* ==================== NEW FEATURES CSS ==================== */

/* Light Theme (default) */
body {
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-secondary: rgba(255,255,255,0.15);
    --card-bg: white;
    --card-text: #202124;
    --card-subtext: #5f6368;
    --input-bg: rgba(255,255,255,0.2);
    --input-border: #e0e0e0;
    --btn-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-color: #667eea;
    --shadow-light: rgba(0,0,0,0.1);
    --shadow-heavy: rgba(0,0,0,0.15);
    --text-color: #202124;
    --text-secondary: #5f6368;
    --top-bar-bg: rgba(255,255,255,0.15);
    --delete-bg: #f1f3f4;
    --delete-hover: #fce8e6;
    --delete-color: #5f6368;
    --modal-bg: white;
}

/* Dark Theme */
body.dark-theme {
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-secondary: rgba(0,0,0,0.3);
    --card-bg: #2d2d44;
    --card-text: #e0e0e0;
    --card-subtext: #a0a0a0;
    --input-bg: rgba(255,255,255,0.1);
    --input-border: #444;
    --btn-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-color: #667eea;
    --shadow-light: rgba(0,0,0,0.3);
    --shadow-heavy: rgba(0,0,0,0.4);
    --text-color: #e0e0e0;
    --text-secondary: #a0a0a0;
    --top-bar-bg: rgba(0,0,0,0.3);
    --delete-bg: #3d3d5c;
    --delete-hover: #4a3d5c;
    --delete-color: #a0a0a0;
    --modal-bg: #2d2d44;
}

body {
    background: var(--bg-primary);
}

/* TOP BAR */
.top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 12px 20px;
    background: var(--top-bar-bg);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

/* USER INFO */
.user-info {
    color: white;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Top Bar Actions */
.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-secondary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: white;
    position: absolute;
    transition: opacity 0.3s ease;
}

.theme-toggle .sun-icon {
    opacity: 1;
}

.theme-toggle .moon-icon {
    opacity: 0;
}

body.dark-theme .theme-toggle .sun-icon {
    opacity: 0;
}

body.dark-theme .theme-toggle .moon-icon {
    opacity: 1;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: rgba(255,255,255,0.25);
}

/* Settings Button */
.settings-btn {
    background: var(--bg-secondary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.settings-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.settings-btn:hover {
    transform: scale(1.1) rotate(30deg);
    background: rgba(255,255,255,0.25);
}

/* Logout Button */
.logout-link {
    text-decoration: none;
}

.logout-btn {
    background: rgba(255,82,82,0.8);
    border: none;
    padding: 10px 20px;
    color: white;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #ff5252;
    transform: scale(1.05);
}

/* TOOLBAR - Search & Filter */
.toolbar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 0 16px;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.search-box svg {
    width: 20px;
    height: 20px;
    fill: #5f6368;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px;
    font-size: 14px;
    color: var(--card-text);
    background: transparent;
}

.search-box input::placeholder {
    color: #9aa0a6;
}

.sort-dropdown select {
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: white;
    color: var(--card-text);
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-light);
    outline: none;
}

/* STATS BAR */
.stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.stat-icon {
    font-size: 1.2rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat-value {
    font-weight: 600;
    font-size: 1rem;
}

/* Entry Card Updates for Theme */
.entry {
    background: var(--card-bg);
    color: var(--card-text);
    box-shadow: 0 1px 2px var(--shadow-light);
}

.entry:hover {
    box-shadow: 0 12px 24px var(--shadow-heavy);
}

.entry h3 {
    color: var(--card-text);
}

.entry p {
    color: var(--card-subtext);
}

.entry-footer {
    color: var(--card-subtext);
}

/* Tags */
.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* DELETE BUTTON Updates */
.delete-btn {
    background: var(--delete-bg);
    color: var(--delete-color);
}

.delete-btn:hover {
    background: var(--delete-hover);
    color: #c5221f;
}

/* Modal Updates for Theme */
.modal-content {
    background: var(--modal-bg);
}

.modal-header h2 {
    color: var(--card-text);
}

.input-container label {
    color: var(--card-text);
}

.modal-content input {
    color: var(--card-text);
    border-bottom-color: var(--input-border);
    background: transparent;
}

.modal-content textarea {
    color: var(--card-text);
    border-bottom-color: var(--input-border);
    background: transparent;
}

/* Responsive Updates */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .top-bar-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .toolbar {
        flex-direction: column;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .stats-bar {
        flex-direction: column;
    }
}
