/* ==========================================================================
   MATCH UP SPINNER STYLES
   Slot machine style random pairing
   ========================================================================== */

/* ==========================================================================
   RIGHT SIDEBAR SCROLLABLE
   ========================================================================== */

.match-up-page .sidebar-right .sidebar-card {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
    height: auto;
}

.match-up-page .sidebar-right .sidebar-card__section {
    flex: none;
}

.match-up-page .sidebar-right .sidebar-card::-webkit-scrollbar {
    width: 6px;
}

.match-up-page .sidebar-right .sidebar-card::-webkit-scrollbar-track {
    background: transparent;
}

.match-up-page .sidebar-right .sidebar-card::-webkit-scrollbar-thumb {
    background: #ffbe4d;
    border-radius: 3px;
}

.match-up-page .sidebar-right .sidebar-card::-webkit-scrollbar-thumb:hover {
    background: #ffa726;
}

/* ==========================================================================
   MATCH UP CENTER
   ========================================================================== */

.match-up-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.match-up-page .wheel-title {
    text-align: center;
    margin-bottom: 30px;
}

.match-up-page .wheel-title h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.match-up-page .wheel-title p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    margin: 0;
}

body:not(.dark-mode) .match-up-page .wheel-title p {
    color: #666;
}

/* ==========================================================================
   SLOT MACHINE CONTAINER
   ========================================================================== */

.match-up-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 20px 0 30px;
    position: relative;
}

/* ==========================================================================
   SLOT MACHINE SLOTS
   ========================================================================== */

.match-up-slot {
    width: 280px;
    background: #1a1a1b;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body:not(.dark-mode) .match-up-slot {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.match-up-slot:hover {
    border-color: rgba(255, 190, 77, 0.3);
}

.match-up-slot.spinning {
    border-color: #ffbe4d;
    box-shadow: 0 0 30px rgba(255, 190, 77, 0.3);
}

.match-up-slot.winner {
    border-color: #ffbe4d;
    animation: slotWin 0.5s ease;
}

@keyframes slotWin {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

/* Slot Header */
.slot-header {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: #81e6d9;
    text-align: center;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dark-mode .slot-header {
    background: linear-gradient(135deg, #3d4a5c 0%, #1a202c 100%);
}

/* Slot Display Window */
.slot-display {
    height: 180px;
    background: #2a2a2b;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

body:not(.dark-mode) .slot-display {
    background: #f5f5f5;
}

/* Slot machine fade edges */
.slot-display::before,
.slot-display::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 2;
    pointer-events: none;
}

.slot-display::before {
    top: 0;
    background: linear-gradient(to bottom, #2a2a2b 0%, transparent 100%);
}

.slot-display::after {
    bottom: 0;
    background: linear-gradient(to top, #2a2a2b 0%, transparent 100%);
}

body:not(.dark-mode) .slot-display::before {
    background: linear-gradient(to bottom, #f5f5f5 0%, transparent 100%);
}

body:not(.dark-mode) .slot-display::after {
    background: linear-gradient(to top, #f5f5f5 0%, transparent 100%);
}

/* Slot Reel */
.slot-reel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    will-change: transform;
}

/* Slot Item */
.slot-item {
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    min-height: 80px;
    box-sizing: border-box;
    text-align: center;
}

body:not(.dark-mode) .slot-item {
    color: #333;
}

/* Image in slot item */
.slot-item.slot-item-image {
    padding: 10px;
}

.slot-item.slot-item-image img {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
    border-radius: 8px;
}

/* ==========================================================================
   VS DIVIDER
   ========================================================================== */

.match-up-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #ffbe4d;
    border-radius: 50%;
    color: #040405;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(255, 190, 77, 0.4);
    flex-shrink: 0;
}

/* ==========================================================================
   SPIN BUTTON
   ========================================================================== */

.match-up-page .spin-button {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 120px;
    height: 120px;
    background: #ffbe4d;
    color: #040405;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 3px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(255, 190, 77, 0.5), 0 0 0 4px rgba(255, 190, 77, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-up-page .spin-button:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px rgba(255, 190, 77, 0.6), 0 0 0 6px rgba(255, 190, 77, 0.3);
}

.match-up-page .spin-button:active {
    transform: scale(0.95);
}

.match-up-page .spin-button:disabled {
    background: #2a2a2b;
    color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
    cursor: not-allowed;
}

body:not(.dark-mode) .match-up-page .spin-button:disabled {
    background: #e0e0e0;
    color: #999;
}

/* ==========================================================================
   ENTRY MODE TABS
   ========================================================================== */

.entry-mode-section {
    padding: 12px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body:not(.dark-mode) .entry-mode-section {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.entry-mode-tabs {
    display: flex;
    gap: 8px;
    background: #2a2a2b;
    border-radius: 12px;
    padding: 4px;
}

body:not(.dark-mode) .entry-mode-tabs {
    background: #f0f0f0;
}

.entry-mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

body:not(.dark-mode) .entry-mode-tab {
    color: #666;
}

.entry-mode-tab:hover {
    background: rgba(255, 190, 77, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

body:not(.dark-mode) .entry-mode-tab:hover {
    color: #333;
}

.entry-mode-tab.active {
    background: #ffbe4d;
    color: #040405;
}

.entry-mode-tab svg {
    flex-shrink: 0;
}

/* ==========================================================================
   ENTRY LIST SECTIONS
   ========================================================================== */

.entry-list-section {
    margin-bottom: 16px;
}

.entry-list-section:last-child {
    margin-bottom: 0;
}

.entry-list-section .section-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
}

/* List icons color coding */
.list-1-icon {
    color: #81e6d9 !important;
}

.list-2-icon {
    color: #ffa726 !important;
}

/* Textareas */
.match-up-page .entries-section textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #2a2a2b;
    color: #fff;
    line-height: 1.5;
    box-sizing: border-box;
}

body:not(.dark-mode) .match-up-page .entries-section textarea {
    background: #f0f0f0;
    color: #333;
    border-color: rgba(0, 0, 0, 0.1);
}

.match-up-page .entries-section textarea:focus {
    outline: none;
    border-color: #ffbe4d;
    box-shadow: 0 0 0 3px rgba(255, 184, 76, 0.15);
}

/* ==========================================================================
   IMAGE UPLOAD AREA
   ========================================================================== */

.image-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

body:not(.dark-mode) .image-upload-area {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.02);
}

.image-upload-area:hover,
.image-upload-area.dragover {
    border-color: #ffbe4d;
    background: rgba(255, 190, 77, 0.05);
}

.image-upload-placeholder {
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

body:not(.dark-mode) .image-upload-placeholder {
    color: #888;
}

.image-upload-placeholder svg {
    margin-bottom: 8px;
}

.image-upload-placeholder p {
    font-size: 12px;
    margin: 0 0 12px;
    text-align: center;
}

/* Add Image Button */
.btn-add-image {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #ffbe4d;
    color: #040405;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-image:hover {
    background: #ffa726;
    transform: translateY(-1px);
}

/* ==========================================================================
   IMAGE PREVIEW GRID
   ========================================================================== */

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* Add margin when grid has images (not empty) */
.image-preview-grid:not(:empty) {
    margin-bottom: 12px;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #2a2a2b;
}

body:not(.dark-mode) .image-preview-item {
    background: #f0f0f0;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview-item:hover .image-remove-btn {
    opacity: 1;
}

.image-remove-btn:hover {
    background: #ff4444;
}

/* ==========================================================================
   STATS GRID FOR MATCH UP
   ========================================================================== */

.match-up-page .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

.match-up-page .stat-item {
    padding: 14px;
}

.match-up-page .stat-value {
    font-size: 20px;
    word-break: break-word;
    line-height: 1.3;
}

.stat-item-last-match .stat-value {
    font-size: 16px;
}

/* Last match images display */
.last-match-images {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.last-match-img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
}

.last-match-plus {
    color: #ffbe4d;
    font-weight: 700;
}

/* ==========================================================================
   RESULTS LIST
   ========================================================================== */

.match-up-page .result-item {
    flex-wrap: wrap;
    gap: 8px;
}

.match-up-page .result-item .result-name {
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    flex: 1 1 100%;
    order: 2;
    margin-top: 4px;
}

.match-up-page .result-item .result-number {
    order: 1;
}

.match-up-page .result-item .result-time {
    order: 1;
    margin-left: auto;
}

/* Result item with images */
.result-item-images .result-images {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.result-item-images .result-thumb {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
}

.result-item-images .result-plus {
    color: #ffbe4d;
    font-weight: 700;
    font-size: 12px;
}

/* ==========================================================================
   RESULT MODAL FOR MATCH UP
   ========================================================================== */

/* Ensure modal displays properly */
.match-up-result {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.match-up-result.show {
    display: flex;
}

.match-up-result .result-content {
    background: #1a1a1b;
    padding: 50px 60px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid #ffbe4d;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 90%;
}

body:not(.dark-mode) .match-up-result .result-content {
    background: #ffffff;
}

.match-up-result .result-decoration {
    margin-bottom: 16px;
    animation: bounce 0.6s ease infinite alternate;
    color: #ffbe4d;
}

.match-up-result .result-content h2 {
    font-size: 32px;
    margin: 0 0 8px 0;
    color: #ffbe4d;
}

.match-up-result .result-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    margin: 0 0 28px 0;
}

body:not(.dark-mode) .match-up-result .result-subtitle {
    color: #666;
}

.match-up-result .match-result-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.match-up-result .match-item {
    background: #2a2a2b;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    border: 2px solid #ffbe4d;
    max-width: 200px;
    word-break: break-word;
}

body:not(.dark-mode) .match-up-result .match-item {
    background: #f0f0f0;
    color: #333;
}

.match-up-result .match-vs {
    font-size: 28px;
    font-weight: 800;
    color: #ffbe4d;
}

/* Result image in modal */
.match-up-result .result-image {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

/* Match item containing image */
.match-up-result .match-item:has(img) {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fallback for browsers without :has() support */
.match-up-result .match-item img {
    display: block;
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    border-radius: 8px;
}

.match-up-result .btn-primary {
    padding: 14px 36px;
    background: #ffbe4d;
    color: #040405;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.match-up-result .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 184, 76, 0.35);
}

@keyframes modalPop {
    from {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-8px);
    }
}

/* ==========================================================================
   FULLSCREEN MODE
   ========================================================================== */

.match-up-center.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: #0a0a0b;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

body:not(.dark-mode) .match-up-center.fullscreen-mode {
    background: #f5f5f5;
}

.match-up-center.fullscreen-mode .wheel-title {
    display: none;
}

.match-up-center.fullscreen-mode .match-up-container {
    transform: scale(1.2);
}

.match-up-center.fullscreen-mode .wheel-controls {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

/* ==========================================================================
   RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 1200px) {
    .match-up-container {
        gap: 20px;
    }

    .match-up-slot {
        width: 220px;
    }

    .slot-display {
        height: 140px;
    }

    .slot-item {
        font-size: 28px;
        min-height: 60px;
    }

    .match-up-vs {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }

    .match-up-page .spin-button {
        width: 100px;
        height: 100px;
        font-size: 14px;
    }
}

@media (max-width: 992px) {
    .match-up-center {
        padding: 20px 15px;
    }

    .match-up-page .wheel-title h1 {
        font-size: 24px;
    }

    .match-up-container {
        flex-wrap: wrap;
        gap: 15px;
    }

    .match-up-slot {
        width: calc(50% - 40px);
        max-width: 200px;
        min-width: 140px;
    }

    .slot-header {
        padding: 10px 15px;
        font-size: 12px;
    }

    .slot-display {
        height: 120px;
    }

    .slot-item {
        font-size: 24px;
        min-height: 50px;
    }

    .match-up-vs {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 10;
        width: 44px;
        height: 44px;
        font-size: 14px;
    }

    .match-up-page .spin-button {
        width: 90px;
        height: 90px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .match-up-page .wheel-title h1 {
        font-size: 22px;
    }

    .match-up-slot {
        width: calc(50% - 30px);
        min-width: 120px;
    }

    .slot-display {
        height: 100px;
    }

    .slot-item {
        font-size: 20px;
        min-height: 45px;
    }

    .slot-item.slot-item-image img {
        max-height: 80px;
    }

    .match-up-vs {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }

    .match-up-page .spin-button {
        width: 80px;
        height: 80px;
        font-size: 12px;
        letter-spacing: 2px;
    }

    .entry-mode-tab {
        padding: 10px 12px;
        font-size: 12px;
    }

    .image-preview-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 576px) {
    .match-up-center {
        padding: 15px 10px;
    }

    .match-up-page .wheel-title h1 {
        font-size: 20px;
    }

    .match-up-container {
        gap: 12px;
    }

    .match-up-slot {
        width: calc(50% - 25px);
        min-width: 110px;
    }

    .slot-header {
        padding: 8px 10px;
        font-size: 11px;
    }

    .slot-display {
        height: 90px;
    }

    .slot-item {
        font-size: 18px;
        min-height: 40px;
        padding: 0 10px;
    }

    .match-up-vs {
        width: 36px;
        height: 36px;
        font-size: 11px;
    }

    .match-up-page .spin-button {
        width: 70px;
        height: 70px;
        font-size: 11px;
    }

    .match-up-result .match-result-display {
        flex-direction: column;
        gap: 12px;
    }

    .match-up-result .match-item {
        font-size: 18px;
        padding: 12px 20px;
    }

    .entry-mode-tab {
        padding: 10px 8px;
        gap: 4px;
    }

    .entry-mode-tab span {
        font-size: 11px;
    }
}

@media (max-width: 400px) {
    .match-up-slot {
        width: calc(50% - 20px);
        min-width: 100px;
    }

    .slot-display {
        height: 80px;
    }

    .slot-item {
        font-size: 16px;
        min-height: 35px;
    }

    .match-up-page .spin-button {
        width: 65px;
        height: 65px;
    }

    .image-preview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Landscape orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .match-up-center.fullscreen-mode .match-up-container {
        transform: scale(0.9);
    }

    .match-up-center.fullscreen-mode .wheel-controls {
        bottom: 15px;
    }
}
