/* Main Container */
:root {
    --mmc-gold: #eec128;
    --mmc-bg-dark: #121212;
    --mmc-text-grey: #666;
    --mmc-btn-grey: #444;
}

body {
    background-color: var(--mmc-bg-dark);
    /* Ensure body matches */
    color: #fff;
    margin: 0;
}

.mmc-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    background-color: #000000;
    font-family: 'Inter', Helvetica, Arial, sans-serif;
    color: #fff;
    min-height: 100vh;
}

/* Inputs & Buttons Reset */
.mmc-container input,
.mmc-container select,
.mmc-container button {
    box-sizing: border-box;
    font-family: inherit;
}

/* --- HOME PAGE GRID STYLES (Kept from previous) --- */

/* Top Bar: Search */
.mmc-top-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.mmc-search-wrapper {
    display: flex;
    width: 100%;
    max-width: 800px;
    gap: 15px;
}

#mmc-search {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 16px;
}

#mmc-actor-search {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #333;
    /* Match select border */
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 16px;
    /* Explicit matching font size */
    width: 100%;
    /* Ensure it fills the wrapper */
    height: 100%;
    /* Ensure it fills the wrapper vertically if needed */
    box-sizing: border-box;
}

.mmc-btn-gold {
    background-color: var(--mmc-gold);
    color: #000;
    border: none;
    padding: 0 15px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.mmc-btn-gold:hover {
    background-color: #f1c40f;
}

/* Filters Row */
.mmc-filters-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    /* Keep wrap for mobile, but on desktop it should be row */
}

.mmc-filters-row select,
.mmc-filters-row input {
    background: #2a2a2a;
    color: #ccc;
    border: 1px solid #333;
    padding: 10px 15px;
    border-radius: 4px;
    min-width: 180px;
    /* Slightly smaller to fit better if needed */
    flex: 1;
    /* Allow growing */
    max-width: 250px;
}

/* Active Filter Message */
.mmc-active-filter {
    text-align: center;
    margin-bottom: 20px;
    color: var(--mmc-gold);
    font-size: 16px;
    font-weight: bold;
}

.mmc-clear-filter {
    background: #444;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-left: 10px;
    text-decoration: none;
    font-size: 12px;
}

.mmc-clear-filter:hover {
    background: #c0392b;
}

/* Pagination Rows (Num + Alpha) */
.mmc-pagination-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.mmc-num-row {
    margin-bottom: 5px;
}

.mmc-filter-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    background: #444;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.mmc-filter-btn:hover {
    background: #666;
}

.mmc-filter-btn.active {
    background: var(--mmc-gold);
    color: #000;
}

/* Grid Logic Update - SWITCH TO CSS GRID (More robust) */
#mmc-movie-grid {
    /* Main Wrapper */
    display: flow-root !important;
    /* Force BFC to contain everything */
    position: relative;
    width: 100%;
    margin-bottom: 0px;
    min-height: 200px;
    /* Prevent collapse */
}

/* The Grid itself (Cards) */
.mmc-grid-items {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    /* Auto-responsive columns */
    gap: 30px 20px;
    justify-content: center;
    width: 100%;
    margin-bottom: 40px !important;
    /* Push pagination down */
}

/* Remove old conflicting class if present */
.mmc-grid {
    display: contents;
    /* Strip layout behavior from this class if used on wrapper */
}

/*
   HYBRID APPROACH:
   Let's make #mmc-movie-grid a custom Flex wrap container OR use float for cards.
   OR (Best for spacing): CSS Grid.
   
   Problem: If #mmc-movie-grid is Display: Grid, the Pagination div becomes a grid item.
   I added grid-column: 1/-1 to pagination, which SHOULD work. 
   If user says it overlaps, maybe the rows aren't auto-sizing properly?
   
   Let's try a different approach: Flexbox for the grid container so items wrap, and pagination is just another item (width 100%).
*/
.mmc-grid-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 15px;
    justify-content: center;
}

.mmc-movie-card {
    /* Reset Flex props */
    width: 100%;
    max-width: 180px;
    margin: 0 auto;
    background: transparent;
    border: none;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Pagination - Flex item in the vertical stack of #mmc-movie-grid */
.mmc-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 10px;
    /* Gap handled by parent flex gap, but extra safety */
    z-index: 5;
}

/* --- BUTTON STYLES --- */
.mmc-btn-action {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    min-width: 140px;
    text-align: center;
}

.mmc-btn-grey {
    background-color: #444;
    color: #fff;
}

.mmc-btn-grey:hover {
    background-color: #555;
    color: #fff;
}


.mmc-movie-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.mmc-movie-card a {
    text-decoration: none;
    color: inherit;
}

.mmc-poster {
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    aspect-ratio: 2/3;
}

.mmc-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mmc-title {
    font-size: 12px;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mmc-year {
    font-size: 11px;
    color: var(--mmc-gold);
    margin-top: 2px;
}

/* --- SINGLE MOVIE PAGE STYLES --- */
.mmc-single-page {
    background: #000;
    color: #fff;
    min-height: 100vh;
}

.mmc-container-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.mmc-single-hero {
    position: relative;
    padding: 60px 0;
    margin-bottom: 40px;
    background-size: cover;
    background-position: center top;
}

.mmc-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, #000 20%, rgba(0, 0, 0, 0.85) 50%, rgba(0, 0, 0, 0.4) 100%),
        linear-gradient(to top, #000 0%, transparent 50%);
    pointer-events: none;
}

.mmc-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 50px;
}

.mmc-hero-poster {
    flex: 0 0 300px;
}

.mmc-hero-poster img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 4px solid #fff;
    /* White border as in reference? Or just nice clean look. Ref has header-like look. */
    /* Screenshot has simple clean rounding */
    border: none;
}

.mmc-hero-details {
    flex: 1;
    padding-top: 20px;
}

.mmc-hero-title {
    font-size: 42px;
    font-weight: 300;
    /* Light/Thin look */
    margin: 0 0 5px;
    color: #fff;
    line-height: 1.1;
}

.mmc-hero-tagline {
    font-style: italic;
    color: #aaa;
    margin-bottom: 10px;
    font-size: 14px;
}

.mmc-hero-original {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.mmc-hero-original span {
    color: var(--mmc-gold);
    font-weight: bold;
}

.mmc-hero-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    font-size: 14px;
    color: #fff;
}

.mmc-meta-star {
    color: var(--mmc-gold);
    font-weight: bold;
}

/* Personal Rating Box Below Poster */
.mmc-personal-rating-box {
    margin-top: 15px;
    padding: 10px 12px;
    background: rgba(238, 193, 40, 0.1);
    border: 2px solid var(--mmc-gold);
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: var(--mmc-gold);
    letter-spacing: 1px;
}

.mmc-meta-rating {
    color: var(--mmc-gold);
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mmc-stars {
    font-size: 16px;
    letter-spacing: 2px;
}

.mmc-stars::before {
    content: '';
}

/* Filled stars in gold, empty stars in gray */
.mmc-meta-rating .mmc-stars {
    background: linear-gradient(to right, var(--mmc-gold) 0%, var(--mmc-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mmc-meta-genre {
    color: var(--mmc-gold);
}

.mmc-hero-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 30px;
}

.mmc-action-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 13px;
    border: none;
    cursor: pointer;
    color: #fff;
}

.mmc-btn-red {
    background: #e74c3c;
}

.mmc-btn-blue {
    background: #3498db;
}

.mmc-collection-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid #2ecc71;
    color: #2ecc71;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
}

.mmc-hero-synopsis {
    line-height: 1.6;
    color: #ccc;
    font-size: 15px;
    margin-bottom: 40px;
    max-width: 800px;
}

.mmc-hero-stats {
    display: flex;
    gap: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mmc-stat-box {
    display: flex;
    flex-direction: column;
}

.mmc-stat-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.mmc-stat-val {
    font-size: 14px;
    font-weight: bold;
}

/* Sections (Cast, Crew) */
.mmc-section {
    margin-bottom: 60px;
}

.mmc-section-title {
    font-size: 16px;
    text-transform: uppercase;
    margin-bottom: 30px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mmc-section-title span {
    color: var(--mmc-gold);
    font-size: 20px;
}

/* Grids */
.mmc-cast-grid,
.mmc-crew-grid {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    /* Center items if few */
}

.mmc-cast-grid {
    justify-content: flex-start;
}

/* Align left for Cast */

.mmc-cast-item,
.mmc-crew-item {
    text-align: center;
    width: 85px;
}

.mmc-cast-photo,
.mmc-crew-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 10px;
    overflow: hidden;
    border: 2px solid var(--mmc-gold);
}

.mmc-cast-photo img,
.mmc-crew-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mmc-cast-name,
.mmc-crew-name {
    font-size: 12px;
    color: #fff;
    line-height: 1.2;
}

.mmc-crew-job {
    font-size: 9px;
    color: var(--mmc-gold);
    text-transform: uppercase;
    margin-top: 5px;
    margin-bottom: 2px;
}

/* Footer Info Area */
.mmc-footer-info {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    padding-bottom: 30px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #000;
}

.mmc-info-col {
    text-align: center;
}

.mmc-info-label {
    display: block;
    font-size: 10px;
    color: #666;
    margin-bottom: 5px;
}

.mmc-info-val {
    font-size: 14px;
    font-weight: bold;
}

/* Bottom Actions */
.mmc-footer-action {
    text-align: center;
    padding: 40px 0;
}

.mmc-back-btn {
    display: inline-block;
    padding: 10px 40px;
    border: 1px solid var(--mmc-gold);
    color: var(--mmc-gold);
    text-decoration: none;
    border-radius: 30px;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s;
}

.mmc-back-btn:hover {
    background: var(--mmc-gold);
    color: #000;
}

/* Pagination */
.mmc-pagination .page-numbers {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 2px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.mmc-pagination .page-numbers.current,
.mmc-pagination .page-numbers:hover {
    background: var(--mmc-gold);
    color: #000;
}

/* Movie Card Hover */
.mmc-movie-card {
    /* Existing transition... */
    transition: transform 0.2s, box-shadow 0.2s;
}

.mmc-poster {
    position: relative;
    border: 3px solid transparent;
    transition: border-color 0.3s;
}

.mmc-poster-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(238, 193, 40, 0.2);
    /* Gold tint */
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.mmc-movie-card:hover .mmc-poster {
    border-color: var(--mmc-gold);
}

.mmc-movie-card:hover .mmc-poster-overlay {
    opacity: 1;
}

.mmc-movie-card:hover .mmc-poster-overlay {
    opacity: 1;
}

/* Actor Autocomplete */
.mmc-autocomplete-wrapper {
    flex: 1;
    /* Match the flex behavior of inputs/selects in .mmc-filters-row */
    min-width: 180px;
    max-width: 250px;
    position: relative;
}

.mmc-autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    /* Align to full width of wrapper */
    background: #2a2a2a;
    border: 1px solid #333;
    border-top: none;
    z-index: 9999;
    /* Ensure high z-index */
    max-height: 250px;
    overflow-y: auto;
    display: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

/* Digital Format Badge */
.mmc-format-digital-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 10px;
    height: 10px;
    background-color: var(--mmc-gold);
    border-radius: 30%;
    z-index: 20;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    border: 1px solid #000;
    /* Contrast border */
}

/* Modal Z-Index */
.mmc-modal-overlay {
    z-index: 99999;
}

/* Single Movie Trailer Button */
.mmc-btn-red {
    background: #cc0000;
    /* YouTube Red */
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mmc-btn-red::before {
    content: "►";
    /* Simple arrow, or use an SVG/Icon if possible */
    font-size: 14px;
    color: #fff;
}

/* Single Info (Status/Discs) */
.mmc-status-badge {
    background: #444;
    color: #ccc;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
    text-transform: uppercase;
    border: 1px solid #555;
}

.mmc-status-badge.seen {
    background: #27ae60;
    color: #fff;
    border-color: #2ecc71;
}

.mmc-status-badge.not_seen {
    background: #c0392b;
    color: #fff;
    border-color: #e74c3c;
}

/* Cast & Crew */
.mmc-cast-grid,
.mmc-crew-grid {
    justify-content: center;
    /* Force center */
}

.mmc-cast-grid {
    justify-content: center !important;
}

/* Clickable Cast */
.mmc-cast-photo a,
.mmc-crew-photo a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 50;
    /* Ensure strictly clickable */
}

/* Responsive */
@media (max-width: 900px) {
    .mmc-hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .mmc-hero-poster {
        width: 200px;
    }

    .mmc-hero-stats {
        justify-content: center;
    }

    .mmc-hero-actions {
        justify-content: center;
    }

    .mmc-hero-meta {
        justify-content: center;
    }

}

/* --- FIXES & NEW UI --- */

/* Pagination - Custom Classes (Bypassing .page-numbers) */
#mmc-pagination-container .mmc-custom-pagination {
    display: block !important;
    text-align: center !important;
    width: 100% !important;
    margin-top: 0px !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
    clear: both !important;
    border-top: 1px dashed #333;
    /* Visual Separator to prove position */
    background: rgba(0, 0, 0, 0.2);
    /* Slight background to prove position */
}

/* Links & Spans */
.mmc-page-link {
    display: inline-block !important;
    vertical-align: middle !important;
    background: #2a2a2a !important;
    border: 1px solid #444 !important;
    color: #fff !important;
    min-width: 40px !important;
    height: 40px !important;
    line-height: 38px !important;
    /* Vertically center text */
    padding: 0 10px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    border-radius: 4px !important;
    margin: 5px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5) !important;
    /* Add shadow for separation visibility */
}

.mmc-page-link:hover,
.mmc-page-link.active {
    background: var(--mmc-gold) !important;
    color: #000 !important;
    border-color: var(--mmc-gold) !important;
    font-weight: bold !important;
}

/* Dots */
.mmc-page-link.dots {
    border: none !important;
    background: transparent !important;
    color: #888 !important;
    box-shadow: none !important;
    cursor: default !important;
}

/* TEMPORARY FIX: Hide prev/next buttons until we fix the detection issue */
.mmc-page-link.prev,
.mmc-page-link.next,
a.mmc-page-link.prev,
a.mmc-page-link.next,
span.mmc-page-link.prev,
span.mmc-page-link.next {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}


/* Disabled Filters */
.mmc-filter-btn.mmc-disabled {
    opacity: 0.2;
    pointer-events: none;
    background: #111;
    color: #444;
    cursor: default;
    border: 1px solid #222;
}

/* Yellow Border on Poster Hover */
.mmc-movie-card:hover .mmc-poster {
    border-color: var(--mmc-gold);
    box-shadow: 0 0 20px rgba(238, 193, 40, 0.3);
}

/* Inline Random Result */
.mmc-random-inline-result {
    display: flex;
    flex-direction: column;
    /* Vertical layout */
    align-items: center;
    /* Center horizontally */
    gap: 20px;
    background: #1a1a1a;
    padding: 30px;
    border: 1px solid #333;
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease;
}

.mmc-random-inline-poster {
    flex: 0 0 150px;
    /* Fixed smaller width */
    max-width: 150px;
}

.mmc-random-inline-poster img {
    width: 100%;
    max-height: 225px;
    /* Maintain 2:3 aspect ratio (150px * 1.5) */
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.mmc-random-inline-info {
    text-align: center;
    /* Center text */
    width: 100%;
}

.mmc-random-inline-info h3 {
    margin-top: 0;
    font-size: 24px;
    color: var(--mmc-gold);
}

.mmc-random-inline-info h3 a {
    text-decoration: none;
    color: inherit;
}

.mmc-random-inline-meta {
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
}

.mmc-random-inline-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    /* Center buttons */
    margin-top: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Single Movie Updates */
.mmc-btn-red::before {
    color: #fff;
    /* Ensure white arrow */
}

/* Non-clickable Disc Badge */
.mmc-disc-badge {
    background: #3498db;
    color: #fff;
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
    cursor: default;
    user-select: none;
}

.mmc-disc-badge::before {
    content: "💿";
    margin-right: 8px;
}

/* Status Display in Single */
.mmc-hero-status {
    display: inline-block;
    margin-left: 0px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    color: #ccc;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 10px;
    border-radius: 4px;
    border: 2px solid #666;
}

/* Responsive Random Inline */
@media (max-width: 700px) {
    .mmc-random-inline-result {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .mmc-random-inline-poster {
        flex: 0 0 auto;
        width: 150px;
    }
}

/* MODAL STYLES */
.mmc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    /* Darker dim */
    z-index: 100000;
    /* Very high z-index */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.mmc-modal-content {
    background: #1a1a1a;
    border: 1px solid var(--mmc-gold);
    border-radius: 8px;
    padding: 30px;
    /* More padding */
    width: 100%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    animation: mmcPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes mmcPopIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.mmc-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    transition: color 0.2s;
}

.mmc-modal-close:hover {
    color: var(--mmc-gold);
}

/* Update Inline Result Styles for Modal Context */
.mmc-random-inline-result {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    max-width: 100%;
    box-shadow: none;
    animation: none;
    /* Modal handle animation */
    display: flex;
    flex-direction: column;
    min-height: 400px;
    /* Ensure enough height for button alignment */
}

/* Ensure text in modal is visible */
#mmc-random-body {
    color: #fff;
}

#mmc-random-loader {
    text-align: center;
    color: var(--mmc-gold);
    font-size: 18px;
    padding: 20px;
}

/* --- CAST & CREW LINKS RESTORED --- */
.mmc-cast-name a,
.mmc-crew-name a {
    color: #fff !important;
    text-decoration: none !important;
    font-weight: normal;
    transition: color 0.2s;
}

.mmc-cast-name a:hover,
.mmc-crew-name a:hover {
    color: var(--mmc-gold) !important;
    text-decoration: underline;
}

/* Ensure images are clickable */
.mmc-cast-photo a,
.mmc-crew-photo a {
    display: block;
    cursor: pointer;
}

/* Trailer Button Arrow Spacing & Style - CORRECTED */
.mmc-btn-red::before {
    content: "";
    width: 0;
    height: 0;
    border-left: 8px solid #fff;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    margin-right: 8px;
    display: inline-block;
}

/* Random Movie Buttons */
.mmc-random-inline-actions .mmc-btn {
    border-radius: 4px;
    font-weight: bold;
    letter-spacing: 1px;
}

.mmc-btn-close-random {
    background: transparent;
    border: 1px solid #666;
    color: #aaa;
    padding: 10px 20px;
    cursor: pointer;
}

.mmc-btn-close-random:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* --- FORMAT BADGES --- */
.mmc-format-badge {
    display: inline-flex;
    align-items: center;
    padding: 9px 15px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    margin-left: 0px;
    cursor: default;
    user-select: none;
    border: 2px solid;
}

/* BR - Blu-ray (Blue) */
.mmc-format-badge.mmc-format-br,
.mmc-format-badge.mmc-format-blu-ray {
    background: rgba(52, 152, 219, 0.2);
    border-color: #3498db;
    color: #3498db;
}

/* 4K - Ultra HD (Purple/Premium) */
.mmc-format-badge.mmc-format-4k,
.mmc-format-badge.mmc-format-uhd {
    background: rgba(155, 89, 182, 0.2);
    border-color: #9b59b6;
    color: #9b59b6;
}

/* DVD (Grey) */
.mmc-format-badge.mmc-format-dvd {
    background: rgba(149, 165, 166, 0.2);
    border-color: #95a5a6;
    color: #95a5a6;
}

/* Digital (Green/Cyan) */
.mmc-format-badge.mmc-format-digital {
    background: rgba(26, 188, 156, 0.2);
    border-color: #1abc9c;
    color: #1abc9c;
}

/* --- SAGA BADGE --- */
.mmc-saga-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(238, 193, 40, 0.2), rgba(238, 193, 40, 0.1));
    border: 2px solid var(--mmc-gold);
    color: var(--mmc-gold);
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 15px;
    box-shadow: 0 0 15px rgba(238, 193, 40, 0.3);
    letter-spacing: 1px;
}

.mmc-saga-icon {
    font-size: 16px;
    margin-right: 5px;
    display: inline-block;
    animation: sagaPulse 2s ease-in-out infinite;
}

@keyframes sagaPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}