/**
 * Dictionary.css - Spiritual & Philosophical Term Definitions
 * 
 * Styling for clickable dictionary terms and definition popup modal
 */

/* ========================================
   Dictionary Term Styling
   ======================================== */

.dict-term {
    /* Subtle styling for clickable terms */
    color: #5a7ba6;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.dict-term:hover {
    color: #3d5a7a;
    text-decoration-style: solid;
    text-decoration-thickness: 1.5px;
}

.dict-term:focus {
    outline: 2px solid #5a7ba6;
    outline-offset: 2px;
    border-radius: 2px;
}

.dict-term:active {
    color: #2d4558;
}

/* ========================================
   Dictionary Modal
   ======================================== */

.dict-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dict-modal.show {
    opacity: 1;
}

.dict-modal-content {
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #f1f5f9;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease, box-shadow 0.2s ease;
}

.dict-modal.show .dict-modal-content {
    transform: translateY(0);
}

/* Close Button */
.dict-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: 1px solid #d1d5db;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.dict-modal-close:hover {
    background: #f9fafb;
    border-color: #8b9d83;
    color: #8b9d83;
    transform: translateY(-1px);
}

.dict-modal-close:focus {
    outline: 2px solid #8b9d83;
    outline-offset: 2px;
}

/* Title */
.dict-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 1.25rem 0;
    padding-right: 40px;
    text-transform: capitalize;
    line-height: 1.4;
}

/* Definition Section */
.dict-definition-section {
    margin-bottom: 1.25rem;
}

.dict-context-badge {
    display: inline-block;
    background: rgba(139, 157, 131, 0.15);
    color: #2d3748;
    padding: 0.35rem 0.85rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(139, 157, 131, 0.35);
}

.dict-definition-text {
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 1rem;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    text-align: left;
    word-wrap: break-word;
}

.dict-separator {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1.25rem 0;
}

/* ========================================
   Mobile Responsive
   ======================================== */

@media (max-width: 768px) {
    .dict-modal {
        padding: 1rem;
    }
    
    .dict-modal-content {
        padding: 1rem;
        max-height: 85vh;
        border-radius: 0.75rem;
    }
    
    .dict-modal-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .dict-modal-close {
        top: 10px;
        right: 10px;
        font-size: 28px;
        width: 36px;
        height: 36px;
    }
    
    .dict-definition-text {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    .dict-context-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .dict-modal-content {
        padding: 0.9rem;
    }
    
    .dict-modal-title {
        font-size: 1.1rem;
        margin-bottom: 0.9rem;
    }
    
    .dict-definition-text {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
}

/* ========================================
   Force Light Theme (Override Dark Mode)
   ======================================== */

/* Override any dark mode preferences - always use light theme */
.dict-modal {
    background-color: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px) !important;
}

.dict-modal-content {
    background: #ffffff !important;
    color: #2d3748 !important;
    border: 1px solid #f1f5f9 !important;
}

.dict-modal-title {
    color: #2d3748 !important;
}

.dict-modal-close {
    background: transparent !important;
    border: 1px solid #d1d5db !important;
    color: #6b7280 !important;
}

.dict-modal-close:hover {
    background: #f9fafb !important;
    border-color: #8b9d83 !important;
    color: #8b9d83 !important;
}

.dict-context-badge {
    background: rgba(139, 157, 131, 0.15) !important;
    color: #2d3748 !important;
    border: 1px solid rgba(139, 157, 131, 0.35) !important;
}

.dict-definition-text {
    background: #f8fafc !important;
    color: #374151 !important;
}

.dict-separator {
    border-top-color: #e2e8f0 !important;
}

/* Ensure clickable terms maintain light theme colors */
.dict-term {
    color: #5a7ba6 !important;
}

.dict-term:hover {
    color: #3d5a7a !important;
}

/* ========================================
   Scrollbar Styling (Webkit)
   ======================================== */

.dict-modal-content::-webkit-scrollbar {
    width: 8px;
}

.dict-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.dict-modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.dict-modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Force light theme scrollbars */
.dict-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
}

.dict-modal-content::-webkit-scrollbar-thumb {
    background: #888 !important;
}

.dict-modal-content::-webkit-scrollbar-thumb:hover {
    background: #555 !important;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .dict-modal {
        display: none !important;
    }
    
    .dict-term {
        text-decoration: none;
        color: inherit;
    }
}

/* ========================================
   Accessibility Enhancements
   ======================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dict-term {
        text-decoration-style: solid;
        text-decoration-thickness: 2px;
        font-weight: 600;
    }
    
    .dict-modal-content {
        border: 2px solid #000;
    }
    
    .dict-context-badge {
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .dict-term,
    .dict-modal,
    .dict-modal-content,
    .dict-modal-close {
        transition: none;
    }
}


