/**
 * Character Notification Styles
 * Responsive notification component with character image and speech bubble
 */

.character-notification {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%) translateX(120%);
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.character-notification.show {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    pointer-events: all;
}

.character-notification.hiding {
    opacity: 0;
    transform: translateY(-50%) translateX(120%) scale(0.8);
}

.character-notification-content {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    max-width: 450px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.character-notification-image {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #8b4513;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.character-notification-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.character-notification-message {
    position: relative;
    flex: 1;
    margin-bottom: 20px;
}

.character-notification-bubble {
    background: linear-gradient(135deg, #f8f4e6 0%, #e8dcc4 100%);
    border: 3px solid #8b4513;
    border-radius: 20px;
    padding: 18px 22px;
    position: relative;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.character-notification-bubble::before {
    content: '';
    position: absolute;
    bottom: 15px;
    left: -15px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 15px 15px 0;
    border-color: transparent #8b4513 transparent transparent;
}

.character-notification-bubble::after {
    content: '';
    position: absolute;
    bottom: 17px;
    left: -9px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 12px 12px 0;
    border-color: transparent #f8f4e6 transparent transparent;
}

.character-notification-bubble p {
    margin: 0;
    color: #2c1810;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

.character-notification-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: 2px solid #fff;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.4);
    z-index: 10;
}

.character-notification-close:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.6);
}

.character-notification-close:active {
    transform: scale(0.95) rotate(90deg);
}

/* Tablet styles */
@media (max-width: 768px) {
    .character-notification {
        right: 15px;
    }

    .character-notification-content {
        max-width: 100%;
        gap: 12px;
    }

    .character-notification-image {
        width: 120px;
        height: 120px;
    }

    .character-notification-bubble {
        padding: 15px 18px;
        border-radius: 16px;
    }

    .character-notification-bubble p {
        font-size: 14px;
    }

    .character-notification-close {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Mobile styles */
@media (max-width: 480px) {
    .character-notification {
        top: auto;
        bottom: 10px;
        right: 10px;
        left: 10px;
        transform: translateX(120%);
    }

    .character-notification.show {
        transform: translateX(0);
    }

    .character-notification.hiding {
        transform: translateX(120%) scale(0.8);
    }

    .character-notification-content {
        gap: 10px;
        flex-direction: column;
        align-items: center;
    }

    .character-notification-image {
        width: 100px;
        height: 100px;
        order: -1;
    }

    .character-notification-message {
        margin-bottom: 0;
        width: 100%;
    }

    .character-notification-bubble {
        padding: 14px 16px;
        border-radius: 14px;
        text-align: center;
    }

    .character-notification-bubble::before,
    .character-notification-bubble::after {
        left: 50%;
        transform: translateX(-50%);
        bottom: auto;
        top: -15px;
        border-width: 15px 15px 0 15px;
        border-color: #8b4513 transparent transparent transparent;
    }

    .character-notification-bubble::after {
        top: -9px;
        border-width: 12px 12px 0 12px;
        border-color: #f8f4e6 transparent transparent transparent;
    }

    .character-notification-bubble p {
        font-size: 13px;
    }

    /* Compact view on mobile until expanded */
    .character-notification:not(.expanded) .character-notification-bubble p {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .character-notification.expanded .character-notification-bubble p {
        -webkit-line-clamp: unset;
        line-clamp: unset;
    }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .character-notification,
    .character-notification-close {
        transition: none;
    }

    .character-notification-content {
        animation: none;
    }

    .character-notification.show {
        transform: translateY(-50%);
    }

    @media (max-width: 480px) {
        .character-notification.show {
            transform: none;
        }
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .character-notification-bubble {
        background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
        border-color: #6b4423;
    }

    .character-notification-bubble::after {
        border-color: transparent #3a3a3a transparent transparent;
    }

    @media (max-width: 480px) {
        .character-notification-bubble::after {
            border-color: #3a3a3a transparent transparent transparent;
        }
    }

    .character-notification-bubble p {
        color: #e8dcc4;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }

    .character-notification-image {
        border-color: #6b4423;
    }
}