/* Base Styles */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333;
    --text-secondary: #6c757d;
    --border-color: #e0e0e0;
    --card-bg: #fff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

/* Resetting default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    font-family: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Arial, sans-serif;
    background: #f7f8fa;
    color: #222;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
}

.center-title {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8em;
    color: #525252;
    opacity: 0.3;
    z-index: -1;
}

/* App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 2rem;
    font-weight: 700;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Search Bar */
.search-container {
    position: relative;
}

.spline-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    scale: 1.3;
    pointer-events: none;
    overflow: hidden;
}

main,
.modal,
.notes-container,
.controls-bar {
    position: relative;
    z-index: 2;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

#search-input {
    padding: 0.5rem 0.5rem 0.5rem 2.5rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    color: var(--text-primary);
    width: 240px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    font-size: 0.95rem;
}

#search-input:focus {
    width: 320px;
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-blue);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Main Content */
main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
    position: relative;
    padding-top: 110px;
}

.page-title {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title h2 {
    font-size: 3.5rem;
    animation: fadeIn 0.5s ease;
}

.controls-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 10;
    /* background: rgba(255, 255, 255, 0.72); */
    backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1.5px solid rgba(200, 200, 200, 0.18);
    box-shadow: 0 8px 32px rgba(60, 60, 130, 0.09);
    border-radius: 0 0 24px 24px;
    transition: background 0.3s, backdrop-filter 0.3s;
    padding: 1.2rem 2.5rem 1.2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    background-color: #cfcfcf;
    border-radius: var(--radius);
    overflow: hidden;
}

.tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.tab.active {
    background-color: rgb(0, 0, 0);
    color: #fff;
}

.tab:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: #000;
    color: #fff;
}

.btn-primary:hover {
    background-color: #111;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-full {
    width: 100%;
}

/* Notes Container */
.notes-container {
    display: grid;
    gap: 1.5rem;
    min-height: 280px;
    position: relative;
}

.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.list-view {
    grid-template-columns: 1fr;
}

/* Note Card */
.note-card {
    border-radius: 22px;
    padding: 2.2rem 1.5rem 1.7rem 1.5rem;
    margin-bottom: 2.2rem;
    min-width: 0;
    transition: box-shadow 0.18s, transform 0.18s, 0.18s;
    display: flex;
    flex-direction: column;
    width: 340px;
    max-width: 100%;
    background-color: #ffffff70;
    color: #ffffff80;
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    position: relative;
    overflow: hidden;
}

.note-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 22px;
    pointer-events: none;
    z-index: 0;
}

.note-card>* {
    position: relative;
    z-index: 1;
}

.note-card:hover {
    box-shadow: 0 16px 48px 0 rgba(31, 38, 135, 0.37), 0 2px 8px rgba(0, 0, 0, 0.13);
    transform: translateY(-2px) scale(1.012);
}

.note-card.pinned {
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3), var(--shadow-md);
}

.note-header {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.8rem;
    margin-bottom: 0.8rem;
    background: none;
    border-radius: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.note-title-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 70%;
}

.note-title {
    font-size: 1.22rem;
    font-weight: 600;
    color: #222;
    margin: 0;
    letter-spacing: -0.01em;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-actions {
    display: flex;
    gap: 0.1rem;
    color: inherit;
}

.note-card:hover .note-actions {
    opacity: 1;
}

.action-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.18rem 0.38rem;
    border-radius: 10px;
    font-size: 1.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.13s, color 0.13s;
}

.action-btn:hover {
    background: #ececec;
    color: #111;
}

.action-btn:active {
    background: #e6e6e6;
    transform: scale(0.97);
}

.pin-btn.active {
    color: #635400;
}

.note-content {
    background: transparent;
    border-radius: 16px;
    margin: 0 0 1.1rem 0;
    padding: 0.7rem 0.2rem 0.7rem 0.2rem;
    color: inherit;
    font-size: 1.07rem;
    min-height: 90px;
    box-shadow: none;
    flex-grow: 1;
    word-break: break-word;
}

.note-card.expanded .note-content {
    max-height: 60vh;
}

.note-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.note-image-container {
    margin-top: 0.75rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.note-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    transition: scale 0.3s ease;
}

.note-image:hover {
    scale: 1.5;
}

.note-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 0.7rem;
    margin-top: 0.7rem;
    background: none;
    border-radius: 0 0 18px 18px;
    font-size: 0.97rem;
    color: #7a7a8c;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.note-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Category Styles */
.note-card.personal {
    border-left: 4px solid var(--accent-purple);
}

.note-card.business {
    border-left: 4px solid var(--accent-green);
}

.note-card.projects {
    border-left: 4px solid var(--accent-blue);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    display: none;
}

.empty-state .emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    padding: 1rem;
}

.close-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.2em;
    border-radius: 4px;
    padding: 0.15rem 0.3rem;
    transition: background 0.12s;
}

.close-btn:hover {
    background: #f0f0f0;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

input[type="text"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 1px var(--accent-blue);
}

.radio-group,
.button-group {
    display: flex;
    gap: 1rem;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Tabs Container */
.tabs-container {
    margin-bottom: 1rem;
}

.tab-content {
    display: none;
    padding-top: 1rem;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* File Input */
.file-input-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.image-preview {
    margin-top: 1rem;
    position: relative;
    display: none;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius);
}

.image-preview .close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Emoji Picker */
.emoji-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.emoji-list {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 0.25rem;
}

.emoji-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.emoji-btn:hover {
    transform: scale(1.2);
}

.emoji-btn:active {
    transform: scale(0.9);
}

/* Dropdown Menu */
.user-menu,
.filter-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    z-index: 100;
    display: none;
}

.dropdown-menu.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-header {
    padding: 0.75rem 1rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Avatar */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.avatar-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Notification */
.notification-btn {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #f44336;
}

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

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

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

/* Drag Animation */
.note-card.dragging {
    opacity: 0.7;
    transform: scale(1.05) rotate(2deg);
    z-index: 1000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-controls {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-container {
        width: 100%;
    }

    #search-input {
        width: 100%;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .controls-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .tabs {
        width: 100%;
        overflow-x: auto;
    }

    .grid-view {
        grid-template-columns: 1fr;
    }
}

.edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f3f3;
    color: #6c63ff;
    border: none;
    border-radius: 6px;
    padding: 0.3rem 0.7rem;
    font-size: 1rem;
    cursor: pointer;
    margin-right: 0.3rem;
    transition: background 0.15s;
}

.edit-btn:hover {
    background: #e0e0ff;
    color: #4a3fc7;
}

.edit-title-input {
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: bold;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.4rem 0.7rem;
    margin-bottom: 0.5rem;
    background: #fff;
    color: #222;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.edit-title-input:focus {
    border-color: #6c63ff;
    background: #f7f7ff;
}

.edit-textarea {
    font-family: inherit;
    font-size: 1rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    background: #fff;
    color: #222;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.5rem;
}

.edit-textarea:focus {
    border-color: #6c63ff;
    background: #f7f7ff;
}

.edit-action-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.note-title-container i,
.action-btn i,
.close-btn i {
    color: inherit;
    font-size: 1.05em;
    vertical-align: middle;
}

.action-btn:active,
.close-btn:active {
    background: #e6e6e6;
    transform: scale(0.93);
}

.note-title:hover,
.note-text:hover {
    cursor: text;
}