/* ===== BASIC RESET & SETUP ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
    transition: all 0.3s ease;
}

/* Dark Mode */
body.dark-mode {
    background: linear-gradient(135deg, #2c3e50 0%, #1a1a2e 100%);
    color: #f0f0f0;
}

/* ===== MAIN CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 30px;
    transition: all 0.3s ease;
}

.dark-mode .container {
    background: rgba(40, 44, 52, 0.95);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* ===== HEADER ===== */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eaeaea;
}

.dark-mode header {
    border-bottom: 2px solid #444;
}

h1 {
    color: #2d3436;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.dark-mode h1 {
    color: #f0f0f0;
}

.subtitle {
    color: #636e72;
    font-size: 1.1rem;
}

.dark-mode .subtitle {
    color: #b2bec3;
}

/* ===== TOOLBAR BUTTONS ===== */
.tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

button {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: #6c5ce7;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
}

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

#btnNew { background: #00b894; }
#btnSave { background: #0984e3; }
#btnDelete { background: #d63031; }
#btnDownload { background: #fdcb6e; color: #333; }
#btnDarkMode { background: #2d3436; }

.dark-mode #btnDarkMode { background: #fdcb6e; color: #333; }

/* ===== NOTE INFO AREA ===== */
.note-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#noteTitle {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.2rem;
    background: white;
}

.dark-mode #noteTitle {
    background: #444;
    border-color: #555;
    color: white;
}

#charCount {
    margin-right: 15px;
    color: #636e72;
    font-weight: bold;
}

.dark-mode #charCount {
    color: #b2bec3;
}

/* ===== TEXT EDITOR AREA ===== */
textarea {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 15px;
    font-size: 1.1rem;
    line-height: 1.6;
    resize: vertical;
    background: white;
    transition: all 0.3s;
}

.dark-mode textarea {
    background: #444;
    border-color: #555;
    color: white;
}

textarea:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

/* ===== STATS BAR ===== */
.stats {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.dark-mode .stats {
    background: #2a2d35;
}

.stats span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #636e72;
}

.dark-mode .stats span {
    color: #b2bec3;
}

/* ===== NOTES LIST ===== */
.notes-list {
    margin-top: 40px;
}

.notes-list h2 {
    margin-bottom: 20px;
    color: #2d3436;
    font-size: 1.8rem;
}

.dark-mode .notes-list h2 {
    color: #f0f0f0;
}

.notes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.note-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    border-left: 5px solid #6c5ce7;
    cursor: pointer;
    position: relative;
}

.dark-mode .note-card {
    background: #2a2d35;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.note-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.note-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #2d3436;
    font-size: 1.2rem;
}

.dark-mode .note-title {
    color: #f0f0f0;
}

.note-preview {
    color: #636e72;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark-mode .note-preview {
    color: #b2bec3;
}

.note-date {
    font-size: 0.85rem;
    color: #74b9ff;
    display: flex;
    align-items: center;
    gap: 5px;
}

.delete-note-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff7675;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
 