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

html {
    height: 100%; /* Ensure html takes full height */
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #4d4d4d; /* Light background for contrast */
    color: #333;
    height: 100%; /* Make body take full height */
    overflow: hidden; /* Prevent body scroll */
    position: relative;
    /* Disable selection and default touch actions */
    touch-action: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* --- Swiper Container --- */
.swiper-container {
    height: 100%;
    width: 100%;
    position: relative; /* Needed for absolute positioning of cards */
    overflow: hidden; /* Hide parts of cards swiped out */
    background-color: #1d1d1d; /* Default background */
}

/* --- Card Base --- */
.card {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: #fff;
    border-radius: 0; /* Full screen on mobile */
    overflow: hidden; /* Clip content like media */
    /* Allow vertical panning only by default, horizontal handled by JS */
    touch-action: pan-y;
    transform: translateX(0) rotate(0); /* Initial position */
    transition: transform 0.3s ease-out; /* Animation for snapping back */
    will-change: transform, opacity; /* Performance hint for animations */
    cursor: grab; /* Indicate draggable */
    display: flex; /* Use flexbox for content layout */
    flex-direction: column; /* Stack media and info vertically */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* Subtle shadow */
}

/* Disable transition during active dragging for smooth movement */
.card.moving {
    transition: none;
}

/* Style for card removal animation */
.card.removing {
    transition: transform 0.5s ease-in, opacity 0.4s ease-in;
}

/* --- Card Content --- */
.card-content {
    flex-grow: 1; /* Allow content area to fill available space */
    position: relative; /* Needed for absolute positioning of children */
    width: 100%; height: 100%;
}

/* Media element (Image or Video) */
.card-media {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover; /* Cover the area, potentially cropping */
    background-color: #eee; /* Placeholder background */
    z-index: 1; /* Below info overlay */
}

/* Info overlay at the bottom */
.card-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 2; /* Above media */
    padding: 15px; /* Inner spacing */
    padding-bottom: 100px; /* Extra space below text, above buttons */
    /* Gradient background for readability */
    background: linear-gradient(to top, rgba(0,0,0,0.85) 10%, rgba(0,0,0,0.6) 50%, transparent 100%);
    color: white; /* Text color */
    pointer-events: none; /* Allow touch events to pass through to card */
}

.card-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7); /* Text shadow for visibility */
    min-height: 24px; /* Add min-height to prevent layout shift when title is empty */
}

/* Style for Like Count */
.card-likes {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px; /* Space between icon and text */
    color: #f0f0f0; /* Light text color */
    margin-bottom: 8px; /* Space below likes */
    min-height: 16px; /* Keep this fix */
}

.card-likes i {
    color: #ff8fa3; /* Pinkish heart icon */
    font-size: 13px;
}

/* Style for Promo Link */
.card-link {
    font-size: 18px;
    color: #ffffff; /* White text for better visibility */
    text-decoration: none;
    display: flex; /* Use flex for centering icon and text */
    align-items: center;
    justify-content: center;
    margin: 15px auto 5px auto; /* Center horizontally with margins */
    background-color: #ff6b9c; /* Bright pink background */
    padding: 12px 20px; /* Larger padding for better tap target */
    border-radius: 25px; /* Rounded corners */
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); /* Add shadow for depth */
    width: auto; /* Adjust width based on content */
    max-width: 80%; /* Limit maximum width */
    min-height: 18px; /* Keep this fix */
    pointer-events: auto; /* Make the link clickable */
    font-weight: bold; /* Make text bold */
    transition: transform 0.2s, background-color 0.2s; /* Smooth transition for hover effects */
}

.card-link:hover, .card-link:active {
    background-color: #ff4384; /* Darker pink on hover/touch */
    transform: scale(1.05); /* Slight grow effect on hover */
}

.card-link i {
    margin-right: 8px; /* Increased space between icon and text */
    font-size: 16px; /* Slightly larger icon */
}

/* Style for Visitor Count */
.card-visitor-count {
    font-size: 14px;
    color: #f0f0f0;
    text-align: center;
    margin-top: 8px;
    pointer-events: none;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.card-visitor-count i {
    color: #FFC107; /* Yellow color for visitors icon */
    margin-right: 5px;
}

/* --- Action Feedback Icons (on card during swipe) --- */
.action-feedback {
    position: absolute;
    top: 40px; /* Position from top */
    border: 4px solid white;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 28px;
    font-weight: bold;
    text-transform: uppercase;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease-in-out; /* Fade in/out */
    z-index: 3; /* Above card info */
    pointer-events: none; /* Not interactive */
    background-color: rgba(0, 0, 0, 0.35); /* Slight dark background */
}

.action-feedback.like {
    left: 15px; 
    color: #24c48f; 
    border-color: #24c48f; /* Green */
    transform: rotate(-15deg); /* Tilted */
}

.action-feedback.dislike {
    right: 15px; 
    color: #fe3c72; 
    border-color: #fe3c72; /* Red */
    transform: rotate(15deg); /* Tilted */
}

.action-feedback.superlike {
    left: 50%; 
    top: 50%; 
    font-size: 32px; 
    color: #3498db; 
    border-color: #3498db; /* Blue */
    transform: translate(-50%, -50%); /* Centered */
}

/* --- Action Buttons (Bottom Controls) --- */
.action-buttons {
    position: absolute; /* Position relative to swiper-container */
    bottom: 20px;
    left: 0; right: 0; /* Span container width */
    display: flex;
    justify-content: space-evenly; /* Distribute buttons evenly */
    align-items: center;
    z-index: 5; /* Above cards */
    padding: 0 10px; /* Horizontal padding */
    width: 100%; /* Ensure it spans the container */
    box-sizing: border-box; /* Include padding in width */
}

.action-button {
    width: 55px; height: 55px; /* Button size */
    border-radius: 50%; /* Circular buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); /* Button shadow */
    border: none;
    cursor: pointer;
    background-color: white; /* Button background */
    transition: transform 0.1s ease-out; /* Press effect */
}

.action-button:active {
    transform: scale(0.95); /* Press effect */
}

.dislike-btn { 
    color: #fe3c72; 
    font-size: 26px; 
} /* Icon color and size */

.like-btn { 
    color: #24c48f; 
    font-size: 26px; 
}

.superlike-btn { 
    color: #3498db; 
    font-size: 22px; 
    width: 45px; 
    height: 45px;
} /* Smaller superlike */

/* --- Loading Indicator --- */
.loading {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #ccc; /* Lighter color for dark background */
    z-index: 10; /* Above everything */
}

/* --- Desktop Styles (Phone-like view) --- */
/* Apply styles only when screen width is 600px or more */
@media (min-width: 600px) {
    body {
        display: flex; /* Enable flexbox */
        align-items: center; /* Vertically center container */
        justify-content: center; /* Horizontally center container */
        padding: 20px; /* Add padding around the container */
        min-height: 100vh; /* Ensure body can contain the centered element */
    }

    .swiper-container {
        /* Explicit dimensions for the phone frame */
        width: 400px;
        height: 750px;

        /* Limit height based on viewport, considering body padding */
        max-height: calc(100vh - 40px);

        /* Prevent flexbox from shrinking the container if space is tight */
        flex-shrink: 0;

        /* Styling for the frame */
        border-radius: 20px;
        box-shadow: 0 15px 40px rgba(0,0,0,0.25);
        border: 5px solid #333; /* Optional border */
        position: relative; /* Keep relative positioning context */
        overflow: hidden; /* Keep overflow hidden */
    }

    .card {
        /* Apply border radius to cards within the frame */
        border-radius: 15px;
        /* Ensure card fills the sized container */
        width: 100%;
        height: 100%;
    }

    /* Action buttons are already positioned absolutely relative to swiper-container */
    .action-buttons {
         bottom: 15px; /* Fine-tune vertical position */
         padding: 0 20px; /* Adjust horizontal padding */
    }
}







        /* Hamburger Menu Styles */
        .hamburger-menu {
            position: fixed;
            top: 20px;
            left: 20px;
            z-index: 1001;
            cursor: pointer;
            width: 40px;
            height: 40px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            background: rgba(0, 0, 0, 0.7);
            border-radius: 8px;
            transition: all 0.3s ease;
        }

        .hamburger-menu:hover {
            background: rgba(0, 0, 0, 0.9);
            transform: scale(1.1);
        }

        .hamburger-line {
            width: 25px;
            height: 3px;
            background: white;
            margin: 3px 0;
            transition: 0.3s;
            border-radius: 2px;
        }

        .hamburger-menu.active .hamburger-line:nth-child(1) {
            transform: rotate(-45deg) translate(-5px, 6px);
        }

        .hamburger-menu.active .hamburger-line:nth-child(2) {
            opacity: 0;
        }

        .hamburger-menu.active .hamburger-line:nth-child(3) {
            transform: rotate(45deg) translate(-5px, -6px);
        }

        /* Side Menu Styles */
        .side-menu {
            position: fixed;
            top: 0;
            left: -300px;
            width: 280px;
            height: 100vh;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            backdrop-filter: blur(20px);
            z-index: 1000;
            transition: left 0.3s ease;
            padding: 80px 0 20px 0;
            box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
        }

        .side-menu.active {
            left: 0;
        }

        .menu-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        .menu-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .menu-header {
            padding: 0 20px 20px 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
            margin-bottom: 20px;
        }

        .menu-header h3 {
            color: white;
            margin: 0;
            font-size: 1.5em;
            font-weight: 300;
            text-align: center;
        }

        .menu-items {
            padding: 0;
            margin: 0;
            list-style: none;
        }

        .menu-item {
            margin: 0;
        }

        .menu-item a {
            display: flex;
            align-items: center;
            padding: 15px 20px;
            color: white;
            text-decoration: none;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
        }

        .menu-item a:hover {
            background: rgba(255, 255, 255, 0.1);
            border-left-color: #ff4081;
            transform: translateX(5px);
        }

        .menu-item i {
            margin-right: 15px;
            width: 20px;
            text-align: center;
            font-size: 1.1em;
        }

        .menu-item span {
            font-size: 1em;
            font-weight: 400;
        }

        .menu-footer {
            position: absolute;
            bottom: 20px;
            left: 20px;
            right: 20px;
            text-align: center;
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.9em;
        }

        /* Responsive adjustments */
        @media (max-width: 480px) {
            .side-menu {
                width: 100%;
                left: -100%;
            }
        }

        /* MODIFIED: Responsive unlock overlay */
        .unlock-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.75);
            z-index: 1000;
            display: flex;
            justify-content: center;
            align-items: center; /* Center on desktop */
            padding: 20px;
            box-sizing: border-box;
            pointer-events: none;
            overflow-y: auto; /* Allow scrolling if needed */
        }

        .unlock-overlay .unlock-content {
            pointer-events: auto;
            color: white;
            text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
            width: 100%;
            max-width: 350px;
            text-align: center;
        }

        .unlock-overlay h2 {
            font-size: 1.4em;
            margin-bottom: 20px;
            line-height: 1.3;
        }

        .unlock-overlay .email-input {
            display: block;
            width: 100%;
            max-width: 300px;
            margin: 20px auto;
            padding: 15px 20px;
            border: 2px solid #fff;
            border-radius: 25px;
            background-color: rgba(255, 255, 255, 0.1);
            color: white;
            font-size: 1.1em;
            text-align: center;
            outline: none;
            transition: background-color 0.2s ease, border-color 0.2s ease;
            box-sizing: border-box;
        }

        .unlock-overlay .email-input::placeholder {
            color: rgba(255, 255, 255, 0.7);
        }

        .unlock-overlay .email-input:focus {
            background-color: rgba(255, 255, 255, 0.2);
            border-color: #ff4081;
        }

        .unlock-overlay .unlock-button {
            display: inline-block;
            margin-top: 25px;
            padding: 15px 30px;
            background-color: #ff4081;
            color: white;
            text-decoration: none;
            border-radius: 50px;
            font-weight: bold;
            font-size: 1.1em;
            border: 2px solid #fff;
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
            transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
            cursor: pointer;
            min-width: 200px;
        }
        
        .unlock-overlay .unlock-button:hover:not(.disabled) {
            transform: scale(1.05);
            background-color: #f50057;
        }

        .unlock-overlay .unlock-button.disabled {
            background-color: #666;
            cursor: not-allowed;
            opacity: 0.5;
        }

        /* Mobile-specific adjustments */
        @media (max-width: 768px) {
            .unlock-overlay {
                align-items: flex-start; /* Move to top on mobile */
                padding-top: 10vh; /* Higher positioning on mobile */
            }
            
            .unlock-overlay h2 {
                font-size: 1.3em;
                margin-bottom: 15px;
            }
            
            .unlock-overlay .email-input {
                padding: 12px 18px;
                font-size: 1em;
                margin: 15px auto;
            }
            
            .unlock-overlay .unlock-button {
                padding: 12px 25px;
                font-size: 1em;
                margin-top: 20px;
            }
        }

        /* Very small screens */
        @media (max-width: 480px) {
            .unlock-overlay {
                align-items: flex-start; /* Keep at top */
                padding-top: 8vh;
                padding-left: 15px;
                padding-right: 15px;
            }
        }

        /* Landscape orientation on mobile */
        @media (max-height: 500px) and (orientation: landscape) {
            .unlock-overlay {
                align-items: flex-start; /* Keep at top in landscape */
                padding-top: 5vh;
            }
            
            .unlock-overlay h2 {
                font-size: 1.2em;
                margin-bottom: 10px;
            }
            
            .unlock-overlay .email-input {
                margin: 10px auto;
                padding: 10px 15px;
            }
            
            .unlock-overlay .unlock-button {
                margin-top: 15px;
                padding: 10px 20px;
            }
        }
