/**
 * PHILOSOPHY HINT STYLES
 *
 * Styling für ausklappbare Philosophie-Hinweise.
 * Basiert auf dem Dark-Mode-Theme des Tiage-Beziehungsmodells.
 *
 * © 2025 Ti-age.de Alle Rechte vorbehalten.
 */

/* ========================================
   CSS VARIABLEN (Theme-Erweiterung)
   ======================================== */

:root {
    /* Hint-spezifische Farben */
    --hint-text: var(--text-secondary, #a0a0b0);
    --hint-text-visible: var(--text-primary, #f0f0f0);
    --hint-link: var(--primary-light, #A8D5E2);
    --hint-link-hover: var(--primary, #457B9D);
    --hint-expanded-bg: rgba(255, 255, 255, 0.03);
    --hint-border: var(--border, rgba(255, 255, 255, 0.1));

    /* Highlight Variant (Moment 3 - Der Spiegel) */
    --hint-highlight-border: var(--toggle-glow, #ff00ff);
    --hint-highlight-bg: rgba(155, 93, 229, 0.08);
    --hint-highlight-glow: var(--toggle-glow-secondary, #9b5de5);
}

/* ========================================
   BASIS-KOMPONENTE
   ======================================== */

.philosophy-hint {
    position: relative;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    background: var(--bg-card, #1a1a2e);
    border-left: 3px solid var(--hint-border);
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
}

.philosophy-hint:hover {
    background: var(--bg-hover, #252542);
}

/* ========================================
   SICHTBARER TEXT
   ======================================== */

.philosophy-hint__visible {
    margin: 0 0 0.5rem 0;
    font-size: var(--font-sm, 0.95rem);
    font-style: italic;
    color: var(--hint-text-visible);
    line-height: 1.5;
    letter-spacing: 0.01em;
}

/* ========================================
   TOGGLE BUTTON (Ausklapp-Link)
   ======================================== */

.philosophy-hint__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
    background: none;
    border: none;
    font-size: var(--font-xs, 0.85rem);
    color: var(--hint-link);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-underline-offset 0.2s ease;
}

.philosophy-hint__toggle:hover {
    color: var(--hint-link-hover);
    text-underline-offset: 5px;
}

.philosophy-hint__toggle:focus {
    outline: 2px solid var(--hint-link);
    outline-offset: 2px;
    border-radius: 2px;
}

.philosophy-hint__toggle::after {
    content: '↓';
    display: inline-block;
    font-size: 0.75em;
    transition: transform 0.3s ease;
}

.philosophy-hint__toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* ========================================
   EXPANDED CONTENT (Ausklappbarer Bereich)
   ======================================== */

.philosophy-hint__expanded {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
        max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        padding 0.3s ease;
}

.philosophy-hint__expanded--open {
    max-height: 600px;
    opacity: 1;
    padding-top: 1rem;
}

.philosophy-hint__expanded p {
    margin: 0 0 0.75rem 0;
    font-size: var(--font-sm, 0.95rem);
    color: var(--hint-text);
    line-height: 1.65;
}

.philosophy-hint__expanded p:last-of-type {
    margin-bottom: 0;
}

/* ========================================
   HIGHLIGHT VARIANT (Moment 3)
   ======================================== */

.philosophy-hint--highlight {
    border-left: 3px solid var(--hint-highlight-border);
    background: var(--hint-highlight-bg);
    box-shadow:
        0 0 20px rgba(155, 93, 229, 0.1),
        inset 0 0 30px rgba(155, 93, 229, 0.03);
}

.philosophy-hint--highlight::before {
    content: '✦';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1rem;
    color: var(--hint-highlight-glow);
    opacity: 0.7;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.philosophy-hint--highlight:hover {
    background: rgba(155, 93, 229, 0.12);
    box-shadow:
        0 0 30px rgba(155, 93, 229, 0.15),
        inset 0 0 40px rgba(155, 93, 229, 0.05);
}

.philosophy-hint--highlight .philosophy-hint__visible {
    color: var(--text-primary);
    font-weight: 500;
}

/* ========================================
   DISMISS BUTTON
   ======================================== */

.philosophy-hint__dismiss {
    display: block;
    margin-top: 1rem;
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px solid var(--hint-border);
    border-radius: 4px;
    font-size: var(--font-xs, 0.8rem);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.philosophy-hint__dismiss:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

/* ========================================
   ANIMATIONS (Ein-/Ausblenden)
   ======================================== */

.philosophy-hint--entering {
    opacity: 0;
    transform: translateY(-10px);
}

.philosophy-hint--leaving {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.philosophy-hint--dismissing {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

/* Dismissed Placeholder (für Layout-Stabilität) */
.philosophy-hint-dismissed {
    display: none;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .philosophy-hint {
        padding: 0.875rem 1rem;
        margin: 0.75rem 0;
    }

    .philosophy-hint__visible {
        font-size: var(--font-xs, 0.9rem);
    }

    .philosophy-hint__toggle {
        font-size: 0.8rem;
    }

    .philosophy-hint__expanded p {
        font-size: var(--font-xs, 0.9rem);
    }

    .philosophy-hint--highlight::before {
        top: 0.75rem;
        right: 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .philosophy-hint {
        padding: 0.75rem;
        border-radius: 0 6px 6px 0;
    }

    .philosophy-hint__expanded--open {
        padding-top: 0.75rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .philosophy-hint,
    .philosophy-hint__toggle,
    .philosophy-hint__toggle::after,
    .philosophy-hint__expanded,
    .philosophy-hint--highlight::before {
        animation: none;
        transition: none;
    }

    .philosophy-hint__expanded--open {
        max-height: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .philosophy-hint {
        border-left-width: 4px;
        border-left-color: var(--text-primary);
    }

    .philosophy-hint__toggle {
        text-decoration-thickness: 2px;
    }

    .philosophy-hint--highlight {
        border-left-color: var(--hint-highlight-border);
        outline: 1px solid var(--hint-highlight-border);
    }
}

/* ========================================
   MOMENTS TOGGLE BUTTON (Header)
   ======================================== */

.moments-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-card, #1a1a2e);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-primary, #f0f0f0);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.moments-toggle-btn:hover {
    background: var(--bg-hover, #252542);
    border-color: var(--hint-highlight-glow, #9b5de5);
    box-shadow: 0 0 10px rgba(155, 93, 229, 0.2);
}

.moments-toggle-btn:focus {
    outline: 2px solid var(--hint-highlight-glow, #9b5de5);
    outline-offset: 2px;
}

.moments-toggle-btn[aria-pressed="true"] {
    border-color: var(--hint-highlight-glow, #9b5de5);
    background: rgba(155, 93, 229, 0.15);
}

.moments-toggle-btn--disabled {
    opacity: 0.7;
    border-color: var(--border, rgba(255, 255, 255, 0.1));
    background: var(--bg-card, #1a1a2e);
}

.moments-toggle-btn--disabled:hover {
    opacity: 1;
    border-color: var(--text-muted, #666);
}

.moments-toggle-icon {
    font-size: 1rem;
    line-height: 1;
}

.moments-toggle-text {
    font-weight: 500;
}

/* Hidden state for moments */
.philosophy-hint--hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .moments-toggle-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .moments-toggle-text {
        display: none;
    }

    .moments-toggle-icon {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .moments-toggle-btn {
        padding: 4px 8px;
    }
}

/* ========================================
   GREETING HINT CONTAINER
   ======================================== */

.greeting-hint-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.greeting-hint-container:empty {
    display: none;
}

@media (max-width: 768px) {
    .greeting-hint-container {
        padding: 0 0.5rem;
    }
}

/* ========================================
   MOMENTS POPUP MODAL
   ======================================== */

.moments-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}

.moments-modal-overlay--visible {
    opacity: 1;
    visibility: visible;
}

.moments-modal {
    position: relative;
    background: var(--bg-card, #1a1a2e);
    border: 1px solid var(--hint-highlight-border, #9b5de5);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow:
        0 0 40px rgba(155, 93, 229, 0.3),
        0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.moments-modal-overlay--visible .moments-modal {
    transform: scale(1) translateY(0);
}

.moments-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.2));
    border-radius: 50%;
    color: var(--text-secondary, #a0a0b0);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1;
}

.moments-modal__close:hover {
    background: var(--bg-hover, #252542);
    border-color: var(--hint-highlight-glow, #9b5de5);
    color: var(--text-primary, #f0f0f0);
    transform: rotate(90deg);
}

.moments-modal__close:focus {
    outline: 2px solid var(--hint-highlight-glow, #9b5de5);
    outline-offset: 2px;
}

.moments-modal__content {
    padding: 2rem;
}

.moments-modal__content .philosophy-hint {
    margin: 0;
    background: transparent;
    border-left: none;
    padding: 0;
}

.moments-modal__content .philosophy-hint:hover {
    background: transparent;
}

.moments-modal__content .philosophy-hint__visible {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary, #f0f0f0);
}

.moments-modal__content .philosophy-hint__toggle {
    font-size: 0.95rem;
}

.moments-modal__content .philosophy-hint__expanded--open {
    padding-top: 1.25rem;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    margin-top: 1rem;
}

.moments-modal__content .philosophy-hint__expanded p {
    font-size: 1rem;
    line-height: 1.7;
}

/* Highlight variant in modal */
.moments-modal__content .philosophy-hint--highlight::before {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .moments-modal-overlay {
        padding: 0.75rem;
    }

    .moments-modal {
        max-height: 85vh;
        border-radius: 10px;
    }

    .moments-modal__content {
        padding: 1.5rem;
    }

    .moments-modal__content .philosophy-hint__visible {
        font-size: 1rem;
    }

    .moments-modal__content .philosophy-hint__expanded p {
        font-size: 0.95rem;
    }

    .moments-modal__close {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .moments-modal-overlay {
        padding: 0.5rem;
    }

    .moments-modal__content {
        padding: 1.25rem;
        padding-top: 2.5rem;
    }

    .moments-modal__close {
        top: 8px;
        right: 8px;
    }
}

/* Accessibility - reduced motion */
@media (prefers-reduced-motion: reduce) {
    .moments-modal-overlay,
    .moments-modal,
    .moments-modal__close {
        transition: none;
    }

    .moments-modal-overlay--visible .moments-modal {
        transform: none;
    }
}

/* ========================================
   SOFT WARNING CARD
   ======================================== */

.soft-warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 1rem;
}

.soft-warning-overlay--visible {
    opacity: 1;
    visibility: visible;
}

.soft-warning-card {
    position: relative;
    background: linear-gradient(145deg, #2a2a42 0%, #1e1e32 100%);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 16px;
    max-width: 440px;
    width: 100%;
    padding: 1.75rem;
    box-shadow:
        0 0 30px rgba(255, 193, 7, 0.15),
        0 20px 40px rgba(0, 0, 0, 0.4);
    transform: scale(0.92) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.soft-warning-overlay--visible .soft-warning-card {
    transform: scale(1) translateY(0);
}

.soft-warning-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: rgba(255, 193, 7, 0.12);
    border-radius: 50%;
    font-size: 1.5rem;
}

.soft-warning-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffc107;
    text-align: center;
    margin: 0 0 1rem 0;
    letter-spacing: 0.02em;
}

.soft-warning-card__message {
    font-size: 0.95rem;
    color: var(--text-secondary, #b0b0c0);
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
    text-align: center;
}

.soft-warning-card__detail {
    font-size: 0.9rem;
    color: var(--text-muted, #888);
    line-height: 1.5;
    margin: 0 0 1.25rem 0;
    padding: 0.875rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid rgba(255, 193, 7, 0.4);
}

.soft-warning-card__examples {
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0b0);
    line-height: 1.7;
    margin: 0 0 1.5rem 0;
    padding: 0.75rem 1rem;
    background: rgba(76, 175, 80, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.soft-warning-card__examples-title {
    display: block;
    font-weight: 500;
    color: #81c784;
    margin-bottom: 0.5rem;
}

.soft-warning-card__example-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0;
}

.soft-warning-card__example-item::before {
    content: '✓';
    color: #81c784;
    font-weight: bold;
}

.soft-warning-card__btn {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.25);
}

.soft-warning-card__btn:hover {
    background: linear-gradient(135deg, #ffca28 0%, #ffc107 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.35);
}

.soft-warning-card__btn:focus {
    outline: 2px solid rgba(255, 193, 7, 0.5);
    outline-offset: 2px;
}

.soft-warning-card__btn:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 480px) {
    .soft-warning-overlay {
        padding: 0.75rem;
    }

    .soft-warning-card {
        padding: 1.5rem 1.25rem;
        border-radius: 14px;
    }

    .soft-warning-card__icon {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }

    .soft-warning-card__title {
        font-size: 1rem;
    }

    .soft-warning-card__message {
        font-size: 0.9rem;
    }

    .soft-warning-card__detail {
        font-size: 0.85rem;
        padding: 0.75rem;
    }

    .soft-warning-card__examples {
        font-size: 0.8rem;
        padding: 0.625rem 0.875rem;
    }

    .soft-warning-card__btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Accessibility - reduced motion */
@media (prefers-reduced-motion: reduce) {
    .soft-warning-overlay,
    .soft-warning-card,
    .soft-warning-card__btn {
        transition: none;
    }

    .soft-warning-overlay--visible .soft-warning-card {
        transform: none;
    }
}
