/* Swipe Mode CSS */
:root {
    --accent-color: #ff4655;
    --accent-hover: #e63a49;
    --text-color: #b0b8c1;
    --text-highlight: #ffffff;
    --bg-dark: #14181c;
    --bg-card: #1e2831;
    --like-color: #4ade80;
    --nope-color: #f87171;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Header */
.header {
    background-color: #1a2029;
    padding: 15px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.site-title {
    font-size: 18px;
    margin: 0;
}

.site-title a {
    color: #778899;
    text-decoration: none;
    transition: color 0.3s;
    margin: 0 5px;
}

.site-title a:hover {
    color: white;
}

/* Main Container */
.swipe-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 20px;
    position: relative;
    touch-action: pan-y pinch-zoom;
    overscroll-behavior: contain;
}

/* Card Stack */
.card-stack {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 600px;
    margin: 0 auto;
    touch-action: none;
}

/* Movie Card */
.movie-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    cursor: grab;
    user-select: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.movie-card:active {
    cursor: grabbing;
}

/* Stack effect - cards behind */
.movie-card[data-stack-position="1"] {
    transform: scale(0.95) translateY(10px);
    opacity: 0.8;
    pointer-events: none;
}

.movie-card[data-stack-position="2"] {
    transform: scale(0.9) translateY(20px);
    opacity: 0.6;
    pointer-events: none;
}

.movie-card[data-stack-position="3"],
.movie-card[data-stack-position="4"],
.movie-card[data-stack-position="5"] {
    opacity: 0;
    pointer-events: none;
}

/* Card Poster */
.card-poster {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.card-poster.no-poster {
    background-color: #2f3842;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #778899;
    font-size: 18px;
}

/* Card Overlay */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
    padding: 30px 20px 20px;
    color: white;
}

.card-info {
    position: relative;
    z-index: 2;
}

.card-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.card-rating {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    display: inline-block;
}

.card-overview {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* Swipe Indicators */
.swipe-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 3;
    pointer-events: none;
}

.swipe-left {
    left: 40px;
    color: var(--nope-color);
    border: 4px solid var(--nope-color);
    border-radius: 50%;
    padding: 10px;
    background: rgba(248, 113, 113, 0.1);
}

.swipe-right {
    right: 40px;
    color: var(--like-color);
    border: 4px solid var(--like-color);
    border-radius: 50%;
    padding: 10px;
    background: rgba(74, 222, 128, 0.1);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 0 20px;
}

.action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.action-btn:disabled:hover {
    transform: scale(1);
}

.undo-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.undo-btn:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
}

.nope-btn {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.nope-btn:hover {
    background: linear-gradient(135deg, #e082ea 0%, #e4465b 100%);
}

.info-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.info-btn:hover {
    background: linear-gradient(135deg, #3e9bed 0%, #00d9e5 100%);
}

.like-btn {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #a8edea 0%, #43e97b 100%);
}

.like-btn:hover {
    background: linear-gradient(135deg, #97dcd9 0%, #32d86a 100%);
}

/* Swipe Counter */
.swipe-counter {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.75);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    backdrop-filter: blur(10px);
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.swipe-counter span {
    font-weight: 700;
    color: #ff4655;
}

/* No More Cards */
.no-more-cards {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 600px;
}

.no-cards-content {
    text-align: center;
}

.no-cards-content h2 {
    font-size: 80px;
    margin-bottom: 20px;
}

.no-cards-content p {
    font-size: 20px;
    color: var(--text-color);
    margin-bottom: 30px;
}

.reload-button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.reload-button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Responsive */
@media screen and (max-width: 600px) {
    .card-stack {
        max-width: 95vw;
        height: calc(100vh - 280px);
        max-height: 600px;
    }

    .swipe-container {
        min-height: auto;
        padding: 10px 20px 20px;
    }

    .card-title {
        font-size: 22px;
    }

    .card-overview {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }

    .action-buttons {
        gap: 15px;
        margin-top: 20px;
    }

    .action-btn {
        width: 55px;
        height: 55px;
    }

    .nope-btn,
    .like-btn {
        width: 65px;
        height: 65px;
    }

    .undo-btn,
    .info-btn {
        width: 45px;
        height: 45px;
    }

    .site-title {
        font-size: 12px;
    }

    .swipe-counter {
        top: 70px;
        right: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Tablet */
@media screen and (min-width: 601px) and (max-width: 1024px) {
    .card-stack {
        max-width: 450px;
        height: 650px;
    }
}

/* Desktop - prevent cards from being too large */
@media screen and (min-width: 1025px) {
    .card-stack {
        max-width: 400px;
        height: 600px;
    }

    .swipe-container {
        min-height: calc(100vh - 150px);
    }
}

/* Loading spinner */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-left-color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Smooth scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
