* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        sans-serif;
}

body {
    background: black url("https://res.danihere.xyz/memoirbg.jpg") no-repeat
        center center fixed;
    background-size: cover;
    min-height: 100vh;
    padding: 20px;
    color: white;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Login Screen */
.login-box {
    background: rgba(0, 0, 0, 0.85);
    padding: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
    margin-top: 100px;
    backdrop-filter: blur(5px);
    height: 50vh;
}

.login-box h1 {
    color: white;
    margin-bottom: 10px;
    font-size: 3em;
    font-weight: 300;
    letter-spacing: 2px;
}

.login-box p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    font-size: 1.1em;
}

.login-box input {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: all 0.3s;
    color: white;
}

.login-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.login-box input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.enter-btn {
    background: rgba(0, 128, 0, 0.7);
    color: white;
    border: 2px solid rgba(0, 128, 0, 0.3);
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 10px;
}

.enter-btn:hover {
    background: rgba(0, 128, 0, 0.9);
    transform: translateY(-2px);
    border-color: rgba(0, 128, 0, 0.5);
}

.hint {
    margin-top: 20px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.5);
}

/* Notes Screen */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

header h1 {
    color: #222;
    font-size: 1.8em;
    font-weight: 300;
    letter-spacing: 1px;
}

.logout-btn {
    background: rgba(0, 128, 0, 0.8);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(0, 128, 0, 1);
}

.note-editor {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

.input_title {
    width: 100%;
    padding: 12px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    color: #333;
}

.input_title:focus {
    outline: none;
    border-color: rgba(0, 128, 0, 0.7);
    box-shadow: 0 0 0 3px rgba(0, 128, 0, 0.1);
}

#noteInput {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    line-height: 1.5;
    color: #333;
    transition: all 0.3s;
}

#noteInput:focus {
    outline: none;
    border-color: rgba(0, 128, 0, 0.7);
    box-shadow: 0 0 0 3px rgba(0, 128, 0, 0.1);
}

.editor-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.save-btn,
.clear-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.save-btn {
    background: rgba(0, 128, 0, 0.8);
    color: white;
    flex: 2;
}

.save-btn:hover {
    background: rgba(0, 128, 0, 1);
}

.clear-btn {
    background: rgba(241, 242, 246, 0.9);
    color: #333;
    flex: 1;
}

.clear-btn:hover {
    background: rgba(228, 229, 233, 0.9);
}

/* Notes List */
.notes-list {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 0 0 15px 15px;
    margin-bottom: 40px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.list-header h2 {
    color: #222;
    font-size: 1.5em;
    font-weight: 300;
    margin: 0;
}

.search-box {
    position: relative;
    width: 250px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: rgba(0, 128, 0, 0.7);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

/* Note Cards */
.note-card {
    background: rgba(248, 249, 250, 0.9);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid rgba(0, 128, 0, 0.8);
    transition: all 0.3s;
}

.note-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.note-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    flex: 1;
}

.note-date {
    color: #7f8c8d;
    font-size: 0.85em;
    white-space: nowrap;
    margin-left: 15px;
}

.note-content {
    color: #34495e;
    line-height: 1.6;
    white-space: pre-wrap;
    margin-top: 10px;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.note-content.expanded {
    max-height: none;
}

.read-more {
    color: rgba(0, 128, 0, 0.8);
    background: none;
    border: none;
    padding: 5px 0;
    font-size: 0.9em;
    cursor: pointer;
    font-weight: 500;
    margin-top: 5px;
    transition: color 0.3s;
}

.read-more:hover {
    color: rgba(0, 128, 0, 1);
}

.note-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(233, 236, 239, 0.8);
}

.action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(221, 221, 221, 0.8);
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    font-weight: 500;
}

.action-btn:hover {
    background: rgba(241, 242, 246, 0.9);
    border-color: rgba(0, 128, 0, 0.5);
    color: rgba(0, 128, 0, 0.9);
}

.action-btn.delete:hover {
    background: rgba(255, 235, 238, 0.9);
    border-color: rgba(255, 71, 87, 0.5);
    color: rgba(255, 71, 87, 0.9);
}

.no-notes {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    background: rgba(248, 249, 250, 0.5);
    border-radius: 10px;
}

.no-notes i {
    font-size: 3em;
    margin-bottom: 15px;
    color: #bdc3c7;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    display: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* Responsive */
@media (max-width: 600px) {
    .login-box,
    header,
    .note-editor,
    .notes-list {
        padding: 20px;
    }

    .login-box {
        border-radius: 20px;
        margin-top: 50px;
    }

    .list-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .editor-controls {
        flex-direction: column;
    }

    .note-header {
        flex-direction: column;
        gap: 5px;
    }

    .note-date {
        margin-left: 0;
        align-self: flex-start;
    }

    .note-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Dark mode scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}
