/* ============================================
   NOTEPAD MODULE STYLES
   ============================================ */

/* Floating Action Button - positioned relative to content area */
.notepad-fab {
    position: fixed;
    bottom: 30px;
    /* Center the button relative to content area (1200px max-width) */
    /* On wide screens: right edge of content + 20px gap */
    /* calc: 50% of viewport - 600px (half content) - 60px (button) - 20px (gap) */
    right: calc(50% - 600px - 80px);
    width: 60px;
    height: 60px;
    background: #2d5016;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(45, 80, 22, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
}

/* On smaller screens where content fills viewport, use fixed right position */
@media (max-width: 1400px) {
    .notepad-fab {
        right: 30px;
    }
}

.notepad-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(45, 80, 22, 0.5);
    background: #3a6b1c;
}

.notepad-fab:active {
    transform: scale(0.95);
}

.notepad-fab-text {
    display: none;
}

.notepad-fab svg {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* Notepad Panel - Desktop, positioned relative to content area */
.notepad-panel {
    position: fixed;
    bottom: 110px;
    /* Match FAB positioning - relative to content area */
    right: calc(50% - 600px - 80px);
    width: 400px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* On smaller screens, use fixed right position */
@media (max-width: 1400px) {
    .notepad-panel {
        right: 30px;
    }
}

.notepad-panel.active {
    display: flex;
}

/* ============================================
   MINIMIZED STATE - Hide content, show only header
   ============================================ */
.notepad-panel.minimized {
    height: auto !important;
    min-height: 0 !important;
}

.notepad-panel.minimized .notepad-content,
.notepad-panel.minimized .notepad-footer {
    display: none !important;
}

.notepad-panel.minimized .notepad-header {
    border-radius: 12px;
}

/* Notepad Header */
.notepad-header {
    background: #2d5016;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.notepad-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
}

.notepad-controls {
    display: flex;
    gap: 8px;
}

.notepad-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.notepad-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Notepad Content */
.notepad-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notepad-meta {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
    color: #6c757d;
}

.notepad-timestamp {
    display: flex;
    align-items: center;
    gap: 4px;
}

.notepad-count {
    color: #adb5bd;
}

.notepad-textarea {
    flex: 1;
    border: none;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    color: #212529;
}

.notepad-textarea::placeholder {
    color: #adb5bd;
}

/* Notepad Footer */
.notepad-footer {
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.notepad-btn-secondary,
.notepad-btn-danger,
.notepad-btn-primary {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.notepad-btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.notepad-btn-secondary:hover {
    background: #dee2e6;
}

.notepad-btn-danger {
    background: #fee;
    color: #dc3545;
}

.notepad-btn-danger:hover {
    background: #fdd;
}

.notepad-btn-primary {
    background: #2d5016;
    color: white;
    padding: 12px 24px;
}

.notepad-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.3);
    background: #3a6b1c;
}

/* All Notes Modal */
.notepad-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.notepad-modal.active {
    display: flex;
}

.notepad-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.notepad-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notepad-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #212529;
}

.all-notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.note-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    border-left: 4px solid #2d5016;
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.note-card-philosopher {
    font-weight: 600;
    color: #212529;
    font-size: 15px;
}

.note-card-timestamp {
    font-size: 12px;
    color: #6c757d;
}

.note-card-content {
    color: #495057;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

.note-card-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.note-card-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    background: white;
    color: #2d5016;
    border: 1px solid #2d5016;
    transition: all 0.2s;
}

.note-card-btn:hover {
    background: #2d5016;
    color: white;
}

.note-card-btn.delete {
    color: #dc3545;
    border-color: #dc3545;
}

.note-card-btn.delete:hover {
    background: #dc3545;
    color: white;
}

.no-notes-message {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-notes-message svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.notepad-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
}

/* Mobile & Tablet Styles */
@media (max-width: 768px) {
    .notepad-fab {
        width: 56px;
        height: 56px;
        bottom: 20px;
        right: 20px;
    }

    /* Mobile: Full-screen bottom sheet */
    .notepad-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 70vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .notepad-panel.active {
        transform: translateY(0);
    }

    .notepad-panel.minimized {
        transform: translateY(calc(100% - 50px));
    }

    .notepad-header {
        cursor: default;
        border-radius: 20px 20px 0 0;
    }

    .notepad-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 2px;
    }

    .notepad-footer {
        flex-direction: column;
    }

    .notepad-btn-secondary,
    .notepad-btn-danger {
        min-width: 100%;
    }

    .notepad-modal-content {
        width: 95%;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .notepad-panel {
        height: 80vh;
    }

    .notepad-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Dragging cursor */
.notepad-header.dragging {
    cursor: grabbing !important;
}

/* Print styles */
@media print {
    .notepad-fab,
    .notepad-panel,
    .notepad-modal {
        display: none !important;
    }
}