/* lesson.css - Styles for lesson save/load functionality */
/* NOTE: Saved lesson CARD styles are in header.css (part of the menu system) */

/* ========================================
   SAVE/LOAD MODAL
   ======================================== */
.lesson-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lesson-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lesson-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.2s ease;
}

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

.lesson-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.lesson-modal-close:hover {
    color: #333;
}

.lesson-modal-title {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.lesson-form-group {
    margin-bottom: 16px;
    position: relative;
}

.lesson-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

.lesson-form-group input[type="text"],
.lesson-form-group textarea,
.lesson-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.lesson-form-group input[type="text"]:focus,
.lesson-form-group textarea:focus,
.lesson-form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.lesson-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.lesson-char-count {
    position: absolute;
    right: 8px;
    bottom: -18px;
    font-size: 11px;
    color: #94a3b8;
}

/* ========================================
   INFO DISPLAY (in save modal)
   ======================================== */
.lesson-form-info {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 20px;
}

.lesson-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
}

.lesson-info-label {
    color: #64748b;
}

.lesson-info-row span:last-child {
    color: #1e293b;
    font-weight: 500;
}

/* ========================================
   MODAL ACTIONS
   ======================================== */
.lesson-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.lesson-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.lesson-btn-primary {
    background: #4CAF50;
    color: white;
}

.lesson-btn-primary:hover {
    background: #43a047;
}

.lesson-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.lesson-btn-secondary:hover {
    background: #e2e8f0;
}

/* ========================================
   ERROR MESSAGE
   ======================================== */
.lesson-error-message {
    color: #dc2626;
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
}

/* ========================================
   MENU ITEMS - SAVE CURRENT BUTTON
   ======================================== */
.menu-save-current-btn {
    width: 100%;
    background: linear-gradient(135deg, #4CAF50 0%, #43a047 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 14px;
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0;  /* Changed from 12px to 0 - gap handled by parent .menu-item margin */
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.menu-save-current-btn:hover {
    background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

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

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

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.lesson-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
}

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

.lesson-toast-success {
    background: #059669;
}

.lesson-toast-error {
    background: #dc2626;
}

.lesson-toast-info {
    background: #3b82f6;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 480px) {
    .lesson-modal-content {
        padding: 20px;
        margin: 10px;
    }

    .lesson-modal-title {
        font-size: 18px;
    }

    .lesson-modal-actions {
        flex-direction: column;
    }

    .lesson-btn {
        width: 100%;
    }

    .lesson-toast {
        left: 10px;
        right: 10px;
        transform: translateX(0) translateY(100px);
        text-align: center;
    }

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

/* ========================================
   LESSON INFO BAR (shown when lesson is loaded)
   ======================================== */
.lesson-info-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
    margin: 10px 0;
}

#lesson-title-display {
    color: #bfc5cf;
    font-size: 16px;
    font-weight: 400;
    border-bottom: 1px solid rgba(156, 163, 175, 0.3);
    padding-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.lesson-notes-icon {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s ease;
}

.lesson-notes-icon.hidden {
    display: none;
}

/* ========================================
   NOTES MODAL (view notes popup)
   ======================================== */
.notes-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.notes-modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.notes-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.notes-modal-header h3 {
    margin: 0;
    color: #1a202c;
    font-size: 18px;
}

.notes-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
    line-height: 1;
}

.notes-modal-close:hover {
    color: #1a202c;
}

.notes-modal-content {
    color: #4a5568;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ========================================
   SHARE MODAL
   ======================================== */
#share-lesson-modal .lesson-modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-lesson-subtitle {
    color: #555;
    margin: 0 0 1.25rem 0;
    font-size: 1em;
    font-style: italic;
    text-align: center;
}

.share-link-container {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.share-link-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: monospace;
    background: #f8f9fa;
    color: #333;
    min-width: 0;
}

.share-link-input:focus {
    outline: none;
    border-color: #4CAF50;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.share-link-input::selection {
    background-color: #4CAF50;
    color: white;
}

#copy-share-link {
    white-space: nowrap;
    padding: 0.75rem 1.25rem;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 100px;
    justify-content: center;
}

#copy-share-link.copied {
    background-color: #2ecc71 !important;
    border-color: #27ae60 !important;
    animation: copySuccess 0.3s ease;
}

@keyframes copySuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.share-link-note {
    font-size: 0.8em;
    color: #777;
    margin: 0.75rem 0 0 0;
    text-align: center;
    line-height: 1.5;
}

.share-modal-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.share-modal-footer .lesson-btn {
    min-width: 100px;
}

/* Responsive adjustments for share modal */
@media (max-width: 480px) {
    .share-link-container {
        flex-direction: column;
    }
    
    .share-link-input {
        font-size: 0.85em;
        padding: 0.6rem 0.8rem;
    }
    
    #copy-share-link {
        width: 100%;
    }
}