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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    position: relative;
    padding-bottom: 60px;
}

.header {
    background-color: #ffffff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-container {
    flex: 1;
    max-width: 300px;
}

#searchBox {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

#searchBox:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
    outline: none;
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.icon-btn {
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-btn {
    background-color: #4CAF50;
}

.add-btn {
    background-color: #2196F3;
}

.icon-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.notes-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.notes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 80px;
}

.note-card {
    background-color: #fff9c4;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.note-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.note-card h3 {
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1.1rem;
}

.note-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.note-card .date {
    position: absolute;
    bottom: 0.5rem;
    right: 1rem;
    font-size: 0.8rem;
    color: #888;
}

.toolbar {
    background-color: #ffffff;
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    border: 1px solid #e9ecef;
    align-items: center;
}

.toolbar button {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    color: #666;
    transition: all 0.2s ease;
    position: relative;
}

.toolbar button:hover {
    background-color: #f1f3f5;
    color: #4CAF50;
}

.toolbar button.active {
    color: #4CAF50;
}

#saveNote {
    margin-left: auto;
    display: none;
}

#saveNote.visible {
    display: flex;
}

#saveNote.has-changes {
    color: #4CAF50;
}

.text-theme-picker {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.text-theme-picker.show {
    display: flex;
    gap: 0.5rem;
}

.text-theme-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.text-theme-light {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
}

.text-theme-yellow {
    background-color: #fff9c4;
    border: 1px solid #e9ecef;
}

.text-theme-dark {
    background-color: #2f3437;
    border: 1px solid #e9ecef;
}

.color-btn {
    position: relative;
    overflow: hidden;
}

.color-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.separator {
    width: 1px;
    background-color: #e9ecef;
    margin: 0 0.5rem;
}

.note-editor {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.note-title-input {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
}

.note-content {
    background-color: #fff9c4;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    min-height: 200px;
    max-height: 500px;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.6;
    overflow-y: auto;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.status {
    font-size: 14px;
    color: #666;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background-color: #f5f5f5;
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    pointer-events: auto;
}

.note-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.note-title-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
}

.note-header-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.note-color-picker {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.note-color-picker.show {
    display: grid;
}

.color-option {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border: 2px solid #4CAF50;
}

.close-btn {
    background-color: #f44336;
    border: none;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.3);
}

.close-btn:hover, .close-btn.active {
    background-color: #d32f2f;
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(244, 67, 54, 0.5);
}

[title="Note Color"] {
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

[title="Note Color"] i {
    color: #000000;
}

.text-theme-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.text-bg-options {
    display: flex;
    gap: 0.5rem;
}

.theme-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    color: #666;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    background-color: #f1f3f5;
    color: #4CAF50;
}

/* Theme classes for note content */
.note-content.theme-light {
    background-color: #ffffff;
    color: #000000;
}

.note-content.theme-yellow {
    background-color: #fff9c4;
    color: #000000;
}

.note-content.theme-dark {
    background-color: #2f3437;
    color: #ffffff;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

.auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    position: relative;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #4CAF50;
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #4CAF50;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form h2 {
    color: #333;
    margin-bottom: 1rem;
}

.auth-form input {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.auth-form input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
    outline: none;
}

.submit-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background-color: #45a049;
    transform: translateY(-1px);
}

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

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

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

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.75rem;
    }

    #searchBox {
        padding: 0.5rem;
        font-size: 13px;
    }

    .icon-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .note-card {
        padding: 0.75rem;
    }

    .toolbar {
        padding: 0.25rem;
        gap: 0.25rem;
    }

    .toolbar button {
        padding: 0.35rem;
    }
}