:root {
    --primary-color: #6366f1;
    --primary-hover: #5b5fc7;
    --secondary-color: #f1f5f9;
    --accent-color: #06b6d4;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --background-primary: #ffffff;
    --background-secondary: #f8fafc;
    --border-color: #e2e8f0;
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-large: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --secondary-color: #1e293b;
    --accent-color: #22d3ee;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --background-primary: #0f172a;
    --background-secondary: #1e293b;
    --border-color: #334155;
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-large: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--background-primary) 0%, var(--background-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    transition: var(--transition);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
}

/* Header with Dark Mode Toggle */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.theme-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 2rem;
    right: 2rem;
    height: 40px;
    width: 40px;
    background: var(--background-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-size: 1.2rem;
    box-shadow: var(--shadow-medium);
    z-index: 10;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-large);
    border-color: var(--primary-color);
}

.theme-toggle:active {
    transform: translateY(0);
}

/* Note Input Area */
#noteInput {
    width: 100%;
    min-height: 150px;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--background-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: var(--transition);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-light);
    outline: none;
}

#noteInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), var(--shadow-medium);
    transform: translateY(-1px);
}

#noteInput::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Save Button */
#saveNote {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-medium);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

#saveNote:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-large);
}

#saveNote:active {
    transform: translateY(0);
}

#saveNote::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#saveNote:hover::before {
    left: 100%;
}

/* Notes Container */
#noteContainer {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Individual Note Cards */
.note {
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.note:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-large);
    border-color: var(--primary-color);
}

.note::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.note-content {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    word-wrap: break-word;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.note-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.delete-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.delete-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 1rem;
    opacity: 0.8;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Delete Button Styling */
.deleteBtn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.deleteBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, #f87171, #ef4444);
}

.deleteBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Optional: Add icon before text */
.deleteBtn::before {
    content: '\f1f8';
    /* Font Awesome trash icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 0.25rem;
}

/* Hover effect with subtle shine */
.deleteBtn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.deleteBtn:hover::after {
    left: 100%;
}

/* Focus state for accessibility */
.deleteBtn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3), 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Dark theme adjustments */
[data-theme="dark"] .deleteBtn {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .deleteBtn:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

[data-theme="dark"] .deleteBtn:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4), 0 4px 12px rgba(239, 68, 68, 0.5);
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

.note {
    animation: slideIn 0.3s ease-out;
}

.note.removing {
    animation: fadeOut 0.3s ease-out forwards;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
        padding: 0.6rem;
        font-size: 1rem;
    }

    #noteContainer {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .note {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    #noteInput {
        min-height: 120px;
        padding: 1rem;
    }

    #saveNote {
        width: 100%;
        padding: 0.875rem;
    }
}