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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    touch-action: manipulation;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* App Container */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.stats {
    display: flex;
    justify-content: space-around;
    font-size: 0.9rem;
    color: #7f8c8d;
    background-color: #ecf0f1;
    padding: 8px;
    border-radius: 20px;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Card Container and Card */
.card-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 20px;
    perspective: 1000px;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    background-color: white;
    overflow: hidden;
    cursor: grab;
}

.card:active {
    cursor: grabbing;
}

.card.swiping {
    transition: transform 0.1s;
}

.card.swipe-left {
    transform: translateX(-1000px) rotate(-30deg);
    transition: transform 0.5s ease-out;
}

.card.swipe-right {
    transform: translateX(1000px) rotate(30deg);
    transition: transform 0.5s ease-out;
}

/* Card animation styles */
.card {
    transition: transform 0.3s, opacity 0.5s ease-out;
}

#image-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

/* Swipe Overlay */
.swipe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    opacity: 0;
    transition: opacity 0.2s;
}

.swipe-left, .swipe-right {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 10px;
    text-transform: uppercase;
}

.swipe-left {
    color: #2ecc71;
    border: 3px solid #2ecc71;
    transform: rotate(-10deg);
}

.swipe-right {
    color: #e74c3c;
    border: 3px solid #e74c3c;
    transform: rotate(10deg);
}

.card.dragging-left .swipe-overlay {
    opacity: 1;
}

.card.dragging-left .swipe-left {
    opacity: 1;
}

.card.dragging-left .swipe-right {
    opacity: 0;
}

.card.dragging-right .swipe-overlay {
    opacity: 1;
}

.card.dragging-right .swipe-right {
    opacity: 1;
}

.card.dragging-right .swipe-left {
    opacity: 0;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.btn {
    border: none;
    background-color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dislike-btn {
    color: #e74c3c;
}

.like-btn {
    color: #2ecc71;
}

.save-btn {
    color: #3498db;
    font-size: 1.2rem;
}

/* No More Images Screen */
#no-more-images {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#no-more-images p {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.restart-btn {
    width: auto;
    height: auto;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 1rem;
    background-color: #3498db;
    color: white;
}

/* Intro Screen */
#intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.intro-content {
    max-width: 500px;
    padding: 30px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.intro-content h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.intro-content p {
    margin-bottom: 15px;
}

.start-btn {
    width: auto;
    height: auto;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    background-color: #2ecc71;
    color: white;
    margin-top: 20px;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .app-container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .card-container {
        width: 280px;
        height: 280px;
    }
    
    .btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .intro-content {
        padding: 20px;
        margin: 0 15px;
    }
}

/* Prevent pull-to-refresh on mobile */
html, body {
    overscroll-behavior-y: contain;
}
