/* Mood Movie Recommender Styles */

.mmr-global-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}

.mmr-intro-text {
    text-align: center;
    margin-bottom: 20px;
}

.mmr-intro-text h2 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.4;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4), 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: mmr-fadeIn 1.2s ease-out forwards;
    opacity: 0;
}

@keyframes mmr-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glassmorphism Container */
.mmr-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Filters */
.mmr-filters {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.mmr-bubbles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.mmr-bubble-btn {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    color: #333;
    font-weight: 500;
}

.mmr-bubble-btn:hover {
    background: #F9BB1B;
}

.mmr-bubble-btn.active {
    background: #254736;
    color: #fff;
    border-color: #254736;
    box-shadow: 0 4px 10px rgba(100, 150, 200, 0.5);
}

.mmr-year-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.4);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    flex-wrap: wrap;
    justify-content: center;
}

.mmr-year-filter input {
    width: 100px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    text-align: center;
    color: inherit;
    transition: all 0.3s ease;
}

.mmr-year-filter-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: mmr-shake 0.4s ease-in-out;
}

@keyframes mmr-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }
}

.mmr-year-filter input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.mmr-surprise-btn {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(236, 72, 153, 0.3);
}

.mmr-surprise-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(236, 72, 153, 0.5);
}

.mmr-surprise-btn.active {
    background: #10b981;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* Chat Area */
.mmr-chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mmr-message {
    display: flex;
    flex-direction: column;
    max-width: 90%;
}

.mmr-user {
    align-self: flex-end;
}

.mmr-bot {
    align-self: flex-start;
}

.mmr-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
}

.mmr-user .mmr-bubble {
    background: #61CE70;
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

.mmr-bot .mmr-bubble {
    background: rgba(255, 255, 255, 0.7);
    color: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom-left-radius: 4px;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Loading */
.mmr-loading {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: auto;
}

.mmr-dot {
    width: 8px;
    height: 8px;
    background: #61CE70;
    border-radius: 50%;
    animation: mmr-bounce 1.4s infinite ease-in-out both;
}

.mmr-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.mmr-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes mmr-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Movie Results List */
.mmr-movies-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 12px;
    width: 100%;
}

.mmr-movie-row {
    display: flex;
    gap: 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.4);
    align-items: stretch;
}

.mmr-poster-container {
    width: 120px;
    flex-shrink: 0;
    position: relative;
    background: #e2e8f0;
}

.mmr-movie-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mmr-movie-details {
    padding: 12px 16px 12px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mmr-movie-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px 0;
    line-height: 1.2;
    color: #0f172a;
}

.mmr-movie-meta {
    font-size: 12px;
    color: #475569;
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.mmr-movie-rating {
    background: #eab308;
    color: #422006;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.mmr-movie-synopsis {
    font-size: 13px;
    color: #334155;
    line-height: 1.4;
    margin-bottom: 12px;
    flex: 1;
}

.mmr-trailer-btn {
    align-self: flex-start;
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mmr-trailer-btn:hover {
    background: #dc2626;
}

/* Similar Content */
.mmr-similar-container {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.mmr-similar-header {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e293b;
}

.mmr-similar-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mmr-similar-chip {
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #334155;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Input Area */
.mmr-input-area {
    padding: 16px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

#mmr-form {
    display: flex;
    gap: 12px;
    margin: 0;
}

#mmr-input {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.6);
    color: #0f172a;
}

#mmr-input:focus {
    border-color: #61CE70;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#mmr-submit {
    background: #254736;
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

#mmr-submit:hover {
    background: #F9BB1B;
    transform: scale(1.05);
}

#mmr-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

.mmr-error-text {
    color: #ef4444;
}

.mmr-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: mmr-spin 1s ease-in-out infinite;
}

@keyframes mmr-spin {
    to { transform: rotate(360deg); }
}

/* Load More Container */
.mmr-load-more-container {
    width: 100%;
    text-align: center;
    margin-top: 16px;
    padding-bottom: 8px;
}

.mmr-load-more-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
    padding: 8px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.mmr-load-more-btn:hover {
    background: white;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Video Modal Layout */
.mmr-video-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.mmr-video-modal.active {
    display: flex;
}

.mmr-video-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.mmr-close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.mmr-close-modal:hover {
    color: #cbd5e1;
}

#mmr-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 600px) {
    .mmr-message, .mmr-bot, .mmr-user {
        max-width: 95%;
    }

    .mmr-movies-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding-top: 8px;
    }

    .mmr-movie-row {
        flex-direction: column;
        position: relative;
        height: 240px;
        cursor: pointer;
        border: none;
        border-radius: 8px;
        overflow: hidden;
        margin-bottom: 0;
    }

    .mmr-poster-container {
        width: 100%;
        height: 100%;
        position: relative;
        z-index: 1;
        background: #000;
    }

    .mmr-movie-poster {
        border-radius: 8px;
    }

    .mmr-movie-details {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 23, 42, 0.85);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        z-index: 2;
        padding: 12px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        border-radius: 8px;
        overflow-y: auto;
    }

    .mmr-movie-row.mmr-tapped .mmr-movie-details {
        opacity: 1;
        pointer-events: auto;
    }

    .mmr-movie-title {
        color: #ffffff !important;
        font-size: 15px;
        margin-bottom: 6px;
    }

    .mmr-movie-meta {
        color: #cbd5e1 !important;
        font-size: 11px;
        gap: 6px;
        margin-bottom: 8px;
    }

    .mmr-movie-synopsis {
        color: #f8fafc !important;
        font-size: 11px;
        margin-bottom: 12px;
        display: -webkit-box;
        -webkit-line-clamp: 5;
        line-clamp: 5;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .mmr-trailer-btn {
        padding: 6px 12px;
        font-size: 12px;
        align-self: flex-start;
        margin-top: auto;
    }
}