/**
 * @file memory-aids.css
 * @description Memory Aids bottom sheet modal - Hook, Links, Roots tabs
 *
 * @requires base.css (CSS variables)
 * @usedBy index.php (#memory-aids-overlay)
 * @usedBy js/components/memory-aids.js (openMemoryAids, renderHook, renderLinks, renderRoots)
 *
 * @status COMPLETE
 */

/* ==================== MEMORY AIDS OVERLAY ==================== */
.memory-aids-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 4500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.memory-aids-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==================== BOTTOM SHEET ==================== */
.memory-aids-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-light);
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform 0.4s var(--ease-smooth);
    z-index: 4501;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.memory-aids-overlay.active .memory-aids-sheet {
    transform: translateY(0);
}

body.dark-mode .memory-aids-sheet {
    background: var(--card-dark);
}

/* Desktop: Center as modal */
@media (min-width: 640px) {
    .memory-aids-sheet {
        position: fixed;
        top: 50%;
        left: 50%;
        bottom: auto;
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
        max-width: 500px;
        width: 90%;
        max-height: 80vh;
        border-radius: 20px;
    }

    .memory-aids-overlay.active .memory-aids-sheet {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* ==================== HEADER ==================== */
.memory-aids-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

body.dark-mode .memory-aids-header {
    border-bottom-color: rgba(255,255,255,0.06);
}

.memory-aids-handle {
    width: 40px;
    height: 4px;
    background: rgba(0,0,0,0.15);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

body.dark-mode .memory-aids-handle {
    background: rgba(255,255,255,0.2);
}

@media (min-width: 640px) {
    .memory-aids-handle {
        display: none;
    }
}

.memory-aids-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.memory-aids-title-icon {
    font-size: 1.3rem;
}

.memory-aids-title-text {
    font-size: 1rem;
    font-weight: 600;
}

.memory-aids-word {
    font-size: 0.85rem;
    opacity: 0.6;
    font-weight: 400;
    margin-left: 4px;
}

.memory-aids-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.06);
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.memory-aids-close:hover {
    background: rgba(0,0,0,0.12);
}

body.dark-mode .memory-aids-close {
    background: rgba(255,255,255,0.1);
}

body.dark-mode .memory-aids-close:hover {
    background: rgba(255,255,255,0.18);
}

/* ==================== TABS ==================== */
.memory-aids-tabs {
    display: flex;
    padding: 0 16px;
    gap: 4px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.dark-mode .memory-aids-tabs {
    border-bottom-color: rgba(255,255,255,0.06);
}

.memory-aids-tab {
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.5;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.memory-aids-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.2s ease;
}

.memory-aids-tab:hover {
    opacity: 0.8;
}

.memory-aids-tab.active {
    opacity: 1;
}

.memory-aids-tab.active::after {
    width: 70%;
}

.memory-aids-tab-icon {
    font-size: 1.2rem;
}

/* ==================== CONTENT ==================== */
.memory-aids-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 250px;
}

.memory-aids-panel {
    display: none;
    animation: fadeInUp 0.3s ease;
}

.memory-aids-panel.active {
    display: block;
}

/* ==================== HOOK PANEL ==================== */
.hook-card {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.08), rgba(76, 201, 240, 0.08));
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
}

body.dark-mode .hook-card {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.15), rgba(76, 201, 240, 0.15));
}

.hook-phrase {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

body.dark-mode .hook-phrase {
    color: var(--primary-light);
}

.hook-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.hook-letter {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.6);
    border-radius: 8px;
    font-size: 0.9rem;
}

body.dark-mode .hook-letter {
    background: rgba(0,0,0,0.2);
}

.hook-letter-char {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    width: 24px;
}

body.dark-mode .hook-letter-char {
    color: var(--primary-light);
}

/* ==================== LINKS PANEL ==================== */
.links-section {
    margin-bottom: 20px;
}

.links-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.links-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.link-chip {
    padding: 6px 14px;
    background: rgba(67, 97, 238, 0.1);
    border-radius: 16px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.link-chip:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

/* ==================== ROOTS PANEL ==================== */
.roots-card {
    padding: 16px;
    background: rgba(67, 97, 238, 0.06);
    border-radius: 12px;
    margin-bottom: 12px;
}

body.dark-mode .roots-card {
    background: rgba(76, 201, 240, 0.1);
}

.roots-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.roots-card-type {
    font-size: 0.65rem;
    text-transform: uppercase;
    padding: 3px 8px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
}

.roots-card-affix {
    font-weight: 600;
    font-size: 1.1rem;
}

.roots-card-meaning {
    font-size: 0.9rem;
    opacity: 0.8;
    font-style: italic;
    margin-bottom: 10px;
}

.roots-card-examples {
    font-size: 0.8rem;
    opacity: 0.6;
}

.roots-card-examples span {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0,0,0,0.04);
    border-radius: 8px;
    margin-right: 6px;
    margin-bottom: 4px;
}

body.dark-mode .roots-card-examples span {
    background: rgba(255,255,255,0.08);
}

/* ==================== EMPTY STATE ==================== */
.memory-aids-empty {
    text-align: center;
    padding: 40px 20px;
}

.memory-aids-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.memory-aids-empty-text {
    font-size: 0.9rem;
    opacity: 0.5;
}
