/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafb 0%, #e8f4f8 100%);
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: #2c3e50;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: none;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.7;
    color: #7f8c8d;
}

/* Editor Section */
.editor-section {
    margin-bottom: 40px;
}

.editor-container {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

#noteEditor {
    width: 100%;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    min-height: 120px;
    max-height: 400px;
    background: #fafbfc;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    overflow-y: hidden;
    line-height: 1.6;
}

#noteEditor:focus {
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#noteEditor::placeholder {
    color: #a0a8b0;
}

.save-btn {
    position: absolute;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.save-btn:active {
    transform: translateY(0);
}

.save-icon {
    font-size: 16px;
}

/* Notes Section */
.notes-section {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: "📄";
    font-size: 1.2rem;
}

/* Notes Grid */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.note-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #f0f2f5;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.note-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
    border-color: #3498db;
}

.note-preview {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: pre-wrap;
}

.note-date {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.note-actions {
    position: absolute;
    bottom: 12px;
    right: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    gap: 4px;
}

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

.action-icon {
    background: rgba(52, 152, 219, 0.1);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-icon:hover {
    background: rgba(52, 152, 219, 0.2);
    transform: scale(1.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1.1rem;
    max-width: 400px;
    margin: 0 auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    border-radius: 16px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #e9ecef;
    color: #333;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.note-content-detail {
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 16px;
    padding: 16px;
    background: #f8fafb;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.note-meta {
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f8f9fa;
}

.action-btn {
    padding: 10px 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.copy-btn {
    background: #e3f2fd;
    color: #1976d2;
    border-color: #e3f2fd;
}

.copy-btn:hover {
    background: #1976d2;
    color: white;
}

.edit-btn {
    background: #f3e5f5;
    color: #7b1fa2;
    border-color: #f3e5f5;
}

.edit-btn:hover {
    background: #7b1fa2;
    color: white;
}

.delete-btn {
    background: #ffebee;
    color: #d32f2f;
    border-color: #ffebee;
}

.delete-btn:hover {
    background: #d32f2f;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    header h1 {
        font-size: 2rem;
    }

    .editor-container {
        padding: 20px;
    }

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

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

    .modal-footer {
        flex-direction: column;
    }

    .action-btn {
        justify-content: center;
    }
}

/* Animations */
.note-card {
    animation: noteSlideIn 0.3s ease;
}

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

/* Success feedback */
.save-btn.saving {
    pointer-events: none;
    opacity: 0.7;
}

.save-btn.saved {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 2000;
    animation: notificationSlide 0.3s ease;
}

@keyframes notificationSlide {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}