:root {
    --primary-red: #fe3c72;
    --primary-green: #4caf50;
    --primary-blue: #424242;
    --background-color: #f5f7fa;
    --card-bg: #fff;
    --text-color: #333;
    --shadow-soft: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 20px 30px -10px rgba(0, 0, 0, 0.2);
    --radius-lg: 20px;
    --radius-md: 12px;
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Dynamic Viewport Height for mobile browsers */
    overflow: hidden;
    color: var(--text-color);
}

/* Header */
header {
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    z-index: 100;
    position: relative; /* Changed from absolute to flow naturally */
    flex-shrink: 0;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    background: linear-gradient(to right, #fd297b, #ff655b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.header-links {
    position: absolute;
    right: 20px;
}

.header-links a {
    color: #ccc;
    transition: color 0.3s;
}

.header-links a:hover, .header-links a.active {
    color: var(--primary-red);
}

/* Main Container */
main {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    width: 100%;
    max-width: 600px; /* Tablet constraint */
    margin: 0 auto;
}

#card-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 700px;
    perspective: 1000px;
}

/* Cards */
.card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    cursor: grab;
    transform-origin: 50% 100%;
    will-change: transform, opacity;
    display: flex;
    flex-direction: column;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    transition: transform 0.5s ease;
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 80px 20px 20px; /* Extra top padding for gradient */
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
    color: white;
    pointer-events: none;
}

.card-info h2 {
    margin: 0 0 5px 0;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.card-info p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card.swiping {
    cursor: grabbing;
    box-shadow: var(--shadow-strong);
}

/* Badges */
.status-badge {
    position: absolute;
    top: 40px;
    padding: 5px 15px;
    border: 4px solid;
    border-radius: 8px;
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: 2px;
    opacity: 0;
    z-index: 10;
    text-transform: uppercase;
}

.status-like {
    left: 40px; /* Changed to left for intuitive swipe right feel */
    color: var(--primary-green);
    border-color: var(--primary-green);
    transform: rotate(-15deg);
}

.status-dislike {
    right: 40px; /* Changed to right for intuitive swipe left feel */
    color: var(--primary-red);
    border-color: var(--primary-red);
    transform: rotate(15deg);
}

/* Controls / Bottom Bar */
.controls {
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding-bottom: var(--safe-area-bottom);
    background: transparent;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e0e0e0; /* Default disabled color */
}

.btn:active {
    transform: scale(0.9);
}

.btn-dislike {
    color: var(--primary-red);
}

.btn-like {
    color: var(--primary-green);
    width: 70px; /* Make like slightly bigger */
    height: 70px;
    font-size: 2.2rem;
}

.btn-superlike {
    color: #3b99fc;
}

/* Empty State */
#no-more-profiles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    padding: 20px;
}

#no-more-profiles h2 {
    color: #ccc;
    margin-bottom: 20px;
}

.btn-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(254, 60, 114, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(254, 60, 114, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(254, 60, 114, 0); }
}

/* Upload Form Styles */
.upload-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.upload-container {
    background: #fff;
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.3s;
    background: #f9f9f9;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary-red);
    outline: none;
    background: #fff;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.btn-submit {
    background: linear-gradient(to right, #fd297b, #ff655b);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 30px; /* Pill shape */
    cursor: pointer;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(253, 41, 123, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(253, 41, 123, 0.4);
}

.btn-submit:active {
    transform: translateY(1px);
}
