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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #1e3c72 100%);
    min-height: 100vh;
    padding: 30px 20px;
}

.logo {
    width: 250px;
    display: block;
    margin: 0 auto 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto 40px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    border: 1.5px solid rgba(255,255,255,0.3);
    transition: box-shadow 0.3s;
    position: relative;
    z-index: 100;
}

.container:hover {
    box-shadow: 0 16px 40px rgba(0,0,0,0.2);
}

input, textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 12px;
    font-size: 16px;
    font-family: Arial;
    background: rgba(255,255,255,0.9);
    color: #1a3a5c;
    transition: all 0.3s ease;
}

input:hover, textarea:hover {
    background: white;
    border-color: #3498db;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

input:focus, textarea:focus {
    outline: none;
    background: white;
    border-color: #3498db;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

textarea {
    height: 250px;
    resize: vertical;
}

button {
    background: white;
    color: #3498db;
    padding: 12px 24px;
    border: 2px solid #3498db;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    transition: all 0.3s ease;
}

button:hover {
    background: white;
    color: #3498db;
    border-color: white;
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8),
                0 0 30px rgba(255, 255, 255, 0.5),
                0 10px 25px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
}

#notesContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 100;
}

.note {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 200px;
}

.note:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.2);
}

.note-top {
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.note-title {
    font-weight: bold;
    font-size: 16px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
}

.note-icons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.note-icons span {
    cursor: pointer;
    font-size: 18px;
    background: rgba(255,255,255,0.25);
    border-radius: 6px;
    padding: 4px 6px;
    transition: background 0.2s, transform 0.2s;
    display: inline-block;
    line-height: 1;
}

.note-icons span:hover {
    background: rgba(255,255,255,0.45);
    transform: scale(1.15);
}

.note-body {
    padding: 12px 14px;
    flex: 1;
    overflow: hidden;
}

.note-body p {
    color: #555;
    line-height: 1.6;
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── MODAL - FIXED CENTERED ── */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
}

.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 24px;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

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

.modal-header {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid #eee;
    z-index: 10;
}

.modal-header button {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

.close-btn {
    border-color: #e74c3c !important;
    color: #e74c3c !important;
}

.close-btn:hover {
    background: #e74c3c !important;
    color: white !important;
}

.modal-stripe {
    height: 6px;
    width: 100%;
    flex-shrink: 0;
}

.modal-content h2 {
    padding: 24px 24px 12px;
    font-size: 24px;
    color: #1a3a5c;
}

#modalText {
    padding: 0 24px 24px;
    line-height: 1.8;
    white-space: pre-wrap;
    color: #444;
    font-size: 15px;
}

#saveBtn {
    margin: 0 24px 24px;
    width: calc(100% - 48px);
    background: white;
    color: #48bb78;
    border: 2px solid #48bb78;
}

#saveBtn:hover {
    background: #48bb78;
    color: white;
}

/* Edit mode - no box */
[contenteditable="true"] {
    outline: none;
    background: transparent;
    border: none;
    padding: 0;
}

[contenteditable="true"]:focus {
    outline: none;
    border: none;
    box-shadow: none;
    background: transparent;
}

/* DELETE POPUP */
.delete-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 20000;
    align-items: center;
    justify-content: center;
}

.delete-popup[style*="display: flex"] {
    display: flex !important;
}

.delete-box {
    background: white;
    border-radius: 20px;
    padding: 32px 28px;
    text-align: center;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.delete-box p {
    font-size: 18px;
    font-weight: bold;
    color: #1a3a5c;
    margin-bottom: 24px;
}

.delete-actions {
    display: flex;
    gap: 12px;
}

.btn-confirm {
    flex: 1;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.btn-cancel {
    flex: 1;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #48bb78;
    color: white;
    padding: 12px 28px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: bold;
    transition: transform 0.3s ease;
    z-index: 30000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Clouds, Rain, Stars - Background only */
.cloud, .rain, .star {
    z-index: 0;
}

body.sunny {
    overflow-x: hidden;
}

.cloud {
    position: fixed;
    background: white;
    border-radius: 1000px;
    z-index: 0;
    pointer-events: none;
    opacity: 0.85;
}

.cloud1 { width: 180px; height: 100px; top: 8%; left: -200px; animation: floatCloud1 28s linear infinite; }
.cloud2 { width: 140px; height: 75px; top: 25%; left: -160px; animation: floatCloud2 35s linear infinite 7s; }
.cloud3 { width: 100px; height: 55px; top: 55%; left: -120px; animation: floatCloud3 22s linear infinite 3s; }
.cloud4 { width: 220px; height: 120px; top: 75%; left: -240px; animation: floatCloud4 40s linear infinite 15s; }
.cloud5 { width: 80px; height: 45px; top: 40%; left: -100px; animation: floatCloud5 18s linear infinite 12s; }

@keyframes floatCloud1 { from { left: -200px; } to { left: 100%; } }
@keyframes floatCloud2 { from { left: -160px; } to { left: 100%; } }
@keyframes floatCloud3 { from { left: -120px; } to { left: 100%; } }
@keyframes floatCloud4 { from { left: -240px; } to { left: 100%; } }
@keyframes floatCloud5 { from { left: -100px; } to { left: 100%; } }

.rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.raindrop {
    position: absolute;
    bottom: 100%;
    background: linear-gradient(transparent, rgba(173, 216, 230, 0.7));
    width: 2px;
    height: 60px;
    border-radius: 2px;
    animation: rainFall linear infinite;
}

@keyframes rainFall {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

.star {
    position: fixed;
    background: white;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle-btn {
    width: auto;
    padding: 10px 20px;
    background: white;
    border: 2px solid #3498db;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
/* ========== DAY MODE (DEFAULT) ========== */
body {
    background: linear-gradient(135deg, #87CEEB 0%, #1e3c72 100%);
}

body .container {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

body input, body textarea {
    background: rgba(255,255,255,0.9);
    color: #1a3a5c;
    border-color: rgba(255,255,255,0.4);
}

body .note {
    background: white;
}

body .note-body p {
    color: #555;
}

body .modal-content {
    background: white;
}

body .modal-header {
    background: white;
    border-bottom-color: #eee;
}

body .modal-content h2 {
    color: #1a3a5c;
}

body #modalText {
    color: #444;
}

body button {
    background: white;
    color: #3498db;
    border: 2px solid #3498db;
}

body button:hover {
    background: white;
    color: #3498db;
    border-color: white;
    box-shadow: 0 0 15px rgba(255,255,255,0.8),
                0 0 30px rgba(255,255,255,0.5);
}

body.night {
    background: linear-gradient(135deg, #0a0a2a 0%, #1a1a3a 100%);
}

body.night .container {
    background: rgba(10, 10, 30, 0.7);
    border-color: rgba(100, 100, 150, 0.3);
}

body.night input, 
body.night textarea {
    background: rgba(30, 30, 60, 0.9);
    color: #e0e0e0;
    border-color: rgba(100, 100, 150, 0.5);
}

body.night input:hover, 
body.night textarea:hover {
    background: #2a2a4a;
    border-color: #6c63ff;
}

body.night input:focus, 
body.night textarea:focus {
    background: #2a2a4a;
    border-color: #6c63ff;
    box-shadow: 0 0 10px rgba(108, 99, 255, 0.3);
}

body.night .note {
    background: #2a2a4a;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

body.night .note:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

body.night .note-body p {
    color: #c0c0e0;
}

body.night .modal-content {
    background: #2a2a4a;
}

body.night .modal-header {
    background: #2a2a4a;
    border-bottom-color: #4a4a6a;
}

body.night .modal-content h2 {
    color: #e0e0e0;
}

body.night #modalText {
    color: #c0c0e0;
}

/* Night mode ALL buttons */
body.night button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

body.night button:hover {
    background: white;
    color: #1a1a3a;
    border-color: white;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
                0 0 40px rgba(255, 255, 255, 0.5),
                0 0 60px rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

/* Night mode modal buttons */
body.night .modal-header button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

body.night .modal-header button:hover {
    background: white;
    color: #1a1a3a;
}

body.night .close-btn {
    border-color: #ff6b6b !important;
    color: #ff6b6b !important;
}

body.night .close-btn:hover {
    background: #ff6b6b !important;
    color: white !important;
}

body.night #saveBtn {
    background: rgba(72, 187, 120, 0.2);
    color: #48bb78;
    border: 2px solid #48bb78;
}

body.night #saveBtn:hover {
    background: #48bb78;
    color: white;
    box-shadow: 0 0 20px rgba(72, 187, 120, 0.6);
}

/* Night mode delete popup */
body.night .delete-box {
    background: #2a2a4a;
}

body.night .delete-box p {
    color: #e0e0e0;
}

body.night .btn-confirm {
    background: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
}

body.night .btn-confirm:hover {
    background: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.5);
}

body.night .btn-cancel {
    background: rgba(149, 165, 166, 0.8);
    color: white;
    border: none;
}

body.night .btn-cancel:hover {
    background: #95a5a6;
    transform: translateY(-2px);
}

body.night .toast {
    background: #2a2a4a;
    color: #e0e0e0;
    border: 1px solid rgba(255,255,255,0.2);
}

body.night .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

body.night .theme-toggle-btn:hover {
    background: white;
    color: #1a1a3a;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

body.night ::-webkit-scrollbar-track {
    background: #1a1a3a;
}

body.night ::-webkit-scrollbar-thumb {
    background: #4a4a6a;
}

body.night ::-webkit-scrollbar-thumb:hover {
    background: #6c63ff;
}
.search-bar {
    max-width: 600px;
    margin: 0 auto 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border-radius: 30px;
    background: rgba(255,255,255,0.9);
}
/* Pinned note styling */
.note.pinned {
    border: 2px solid gold;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.pin-icon {
    cursor: pointer;
    font-size: 16px;
    background: rgba(255,255,255,0.25);
    border-radius: 6px;
    padding: 4px 6px;
    transition: all 0.2s;
    margin-right: 5px;
}

.pin-icon:hover {
    transform: scale(1.15);
}

.pin-icon.pinned {
    color: gold;
    text-shadow: 0 0 5px gold;
}

/* Pinned section header */
.pinned-header {
    grid-column: 1 / -1;
    margin: 20px 0 10px 0;
    padding: 10px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    text-align: center;
    color: gold;
    font-weight: bold;
    font-size: 18px;
}
.voice-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.voice-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.voice-card-icon {
    font-size: 32px;
}

.voice-card-info {
    flex: 1;
}

.voice-card-title {
    font-size: 16px;
    font-weight: bold;
    color: white;
    margin-bottom: 4px;
}

.voice-card-desc {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
}

.voice-card-wave {
    display: flex;
    gap: 3px;
    align-items: center;
}

.voice-card-wave span {
    width: 3px;
    height: 15px;
    background: white;
    border-radius: 2px;
    animation: wave 0.8s ease-in-out infinite;
}

.voice-card-wave span:nth-child(1) { animation-delay: 0s; height: 10px; }
.voice-card-wave span:nth-child(2) { animation-delay: 0.1s; height: 20px; }
.voice-card-wave span:nth-child(3) { animation-delay: 0.2s; height: 15px; }
.voice-card-wave span:nth-child(4) { animation-delay: 0.3s; height: 8px; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

.stop-voice-btn {
    width: auto !important;
    background: #e74c3c !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    margin-top: 10px !important;
    animation: pulseRed 1s infinite !important;
    border-radius: 50px !important;
    font-weight: bold !important;
}

@keyframes pulseRed {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
}