:root {
    --vh: 1vh;
}

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

html {
    height: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0f4c3a, #1a5d4a, #2d8659);
    height: 100%;
    color: white;
    overflow: hidden;
    position: fixed;
    width: 100%;
    
    /* Prevent bounce scrolling */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    
    /* Disable text selection and callouts */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    
    /* Disable tap highlighting */
    -webkit-tap-highlight-color: transparent;
}

/* Allow text selection in input fields */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    position: relative;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    
    /* Safe area support for iPhone X+ */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}vh;
    position: relative;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* Auth Hero Section */
.auth-hero {
    text-align: center;
    padding: 40px 20px 30px;
    padding-top: max(40px, calc(env(safe-area-inset-top) + 20px));
    background: linear-gradient(135deg, rgba(15, 76, 58, 0.3), rgba(45, 134, 89, 0.3));
    backdrop-filter: blur(15px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.auth-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.auth-tree-animation {
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.auth-tree-animation .tree {
    font-size: 5em;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    display: inline-block;
    animation: rotate-tree 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes rotate-tree {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.auth-title {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    font-weight: bold;
    background: linear-gradient(135deg, #ffffff, #d4af37);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.auth-subtitle {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 25px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    font-weight: 500;
}

.auth-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s ease;
}

.feature-item:active {
    transform: scale(0.95);
}

.feature-icon {
    font-size: 2em;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: bounce 2s ease-in-out infinite;
}

.feature-item:nth-child(2) .feature-icon {
    animation-delay: 0.2s;
}

.feature-item:nth-child(3) .feature-icon {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.feature-text {
    font-size: 0.85em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header {
    text-align: center;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top));
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-form {
    padding: 35px 30px;
    max-width: 380px;
    margin: 30px auto;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 25px;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 20px;
}

.form-title {
    text-align: center;
    font-size: 1.6em;
    margin-bottom: 8px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.form-subtitle {
    text-align: center;
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 25px;
    font-weight: 400;
}

.divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.divider span {
    position: relative;
    top: -12px;
    background: linear-gradient(135deg, #0f4c3a, #2d8659);
    padding: 0 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-size: 16px; /* Prevents zoom on iOS */
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.form-group input::placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-weight: 400;
}

.form-group input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.btn {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #d4af37, #f4d03f, #ffeb3b);
    background-size: 200% 200%;
    color: #1a3312;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.3);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-icon {
    position: relative;
    z-index: 1;
    font-size: 1.2em;
    animation: wiggle 2s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.12);
}

.main-content {
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    display: none;
}

.main-content.active {
    display: block;
}

.nav-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin-bottom: 20px;
    overflow: hidden;
}

.nav-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: bold;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.nav-tab.active {
    background: rgba(255, 255, 255, 0.2);
}

.nav-tab:active {
    transform: scale(0.98);
}

.swipe-container {
    position: relative;
    height: 500px;
    perspective: 1000px;
    margin-bottom: 20px;
    touch-action: pan-y; /* Allow vertical scrolling but handle horizontal gestures */
}

.card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.3s ease;
    overflow: hidden;
    border: 3px solid transparent;
    touch-action: none; /* Handle all touch events manually */
}

.card:active {
    cursor: grabbing;
}

.card img {
    width: 100%;
    height: 70%;
    object-fit: cover;
    pointer-events: none; /* Prevent image dragging */
}

.card-info {
    padding: 20px;
    color: #333;
    pointer-events: none; /* Prevent text selection during swipe */
}

.card-info h3 {
    margin-bottom: 5px;
    font-size: 1.2em;
}

.card-info p {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.card-votes {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.vote-count {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
}

.vote-count.likes {
    color: #2ecc71;
}

.vote-count.dislikes {
    color: #e74c3c;
}

.swipe-buttons {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.swipe-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

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

.swipe-btn:hover {
    transform: scale(1.1);
}

.dislike-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
}

.like-btn {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
}

.super-like-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
}

.upload-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.upload-section h3 {
    margin-bottom: 15px;
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    touch-action: manipulation;
}

.upload-area:active {
    transform: scale(0.98);
}

.upload-area:hover {
    border-color: #d4af37;
    background: rgba(255, 255, 255, 0.05);
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.my-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.photo-item {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

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

.photo-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 12px;
    touch-action: manipulation;
}

.photo-item .photo-stats {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    font-size: 0.8em;
    display: flex;
    justify-content: space-between;
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.match-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.match-item:active {
    transform: scale(0.98);
}

.match-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.match-item img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #d4af37;
}

.stat-label {
    font-size: 0.9em;
    margin-top: 5px;
}

.no-cards {
    text-align: center;
    padding: 50px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.no-cards h3 {
    margin-bottom: 10px;
    font-size: 1.5em;
}

.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
}

/* Toast Message System */
.message-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    max-width: 90%;
    width: 380px;
    padding: 18px 24px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 15px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
}

.message-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.message-toast.message-success {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.95), rgba(39, 174, 96, 0.95));
    color: white;
    border: 2px solid rgba(46, 204, 113, 0.5);
}

.message-toast.message-error {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.95), rgba(192, 57, 43, 0.95));
    color: white;
    border: 2px solid rgba(231, 76, 60, 0.5);
}

.message-toast.message-info {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.95), rgba(41, 128, 185, 0.95));
    color: white;
    border: 2px solid rgba(52, 152, 219, 0.5);
}

.message-icon {
    font-size: 1.5em;
    flex-shrink: 0;
    animation: icon-pop 0.5s ease;
}

@keyframes icon-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.message-text {
    flex: 1;
    line-height: 1.4;
}

/* Input Error Styling */
.input-error {
    border-color: #e74c3c !important;
    background: rgba(255, 200, 200, 0.95) !important;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.2) !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Legacy message styles (for backward compatibility) */
.success-message {
    background: rgba(46, 204, 113, 0.9);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    text-align: center;
    border-left: 4px solid #2ecc71;
}

.error-message {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    text-align: center;
    border-left: 4px solid #e74c3c;
}

.info-message {
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    text-align: center;
    border-left: 4px solid #3498db;
}

/* Snowfall Animation */
.snowflake {
    position: fixed;
    top: -10px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 20px;
    animation: fall linear infinite;
    pointer-events: none;
    z-index: 1000;
}

@keyframes fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Mobile Responsive & PWA optimizations */
@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }

    .auth-hero {
        padding: 30px 15px 20px;
    }

    .auth-tree-animation .tree {
        font-size: 4em;
    }

    .auth-title {
        font-size: 2em;
    }

    .auth-subtitle {
        font-size: 1em;
    }

    .auth-features {
        gap: 20px;
        padding: 15px;
    }

    .feature-icon {
        font-size: 1.8em;
    }

    .feature-text {
        font-size: 0.75em;
    }

    .auth-form {
        margin: 20px 15px;
        padding: 25px 20px;
    }

    .form-title {
        font-size: 1.4em;
    }

    .form-subtitle {
        font-size: 0.9em;
    }

    .main-content {
        padding: 15px;
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }

    .nav-tab {
        font-size: 12px;
        padding: 12px;
    }

    .swipe-container {
        height: 400px;
    }
}

/* Landscape mode adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .header {
        padding: 10px;
        padding-top: max(10px, env(safe-area-inset-top));
    }
    
    .header h1 {
        font-size: 1.5em;
        margin-bottom: 5px;
    }
    
    .swipe-container {
        height: 300px;
    }
    
    .auth-form {
        margin: 20px auto;
        padding: 20px;
    }
}

/* Dark mode support (if system prefers dark) */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark theme */
}

/* Enhanced Upload UI Styles */
.upload-container {
    margin-bottom: 15px;
}

.upload-area {
    border: 3px dashed rgba(255, 255, 255, 0.4) !important;
    border-radius: 15px !important;
    padding: 30px 20px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    cursor: default !important;
}

.upload-area:hover {
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.upload-area #photo-input {
    display: none;
}

.upload-area p {
    margin: 10px 0;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
}

.upload-icon {
    font-size: 3em !important;
    margin-bottom: 10px !important;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.btn-select {
    margin-top: 15px;
    background: linear-gradient(135deg, #2980b9, #3498db);
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    border-radius: 10px;
    color: white;
    transition: all 0.2s;
    touch-action: manipulation;
}

.btn-select:hover {
    background: linear-gradient(135deg, #3498db, #5dade2);
    transform: translateY(-2px);
}

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

.btn-upload {
    width: 100%;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    font-size: 1.1em;
    font-weight: bold;
    padding: 15px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-upload:not(:disabled):hover {
    background: linear-gradient(135deg, #2ecc71, #58d68d);
    transform: translateY(-2px);
}

.btn-upload:not(:disabled):active {
    transform: scale(0.98);
}

.btn-upload .btn-icon {
    font-size: 1.2em;
}

.image-preview-container {
    position: relative;
    margin-bottom: 20px;
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid #2ecc71;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.3);
}

.image-preview-container img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    touch-action: manipulation;
}

.remove-image-btn:hover {
    background: rgba(192, 57, 43, 1);
    transform: scale(1.1);
}

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

.upload-status {
    margin-top: 15px;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.upload-status.uploading {
    background: rgba(52, 152, 219, 0.3);
    border: 2px solid #3498db;
    color: white;
}

.upload-status.success {
    background: rgba(46, 204, 113, 0.3);
    border: 2px solid #2ecc71;
    color: white;
}

.upload-status.error {
    background: rgba(231, 76, 60, 0.3);
    border: 2px solid #e74c3c;
    color: white;
}

/* View Toggle Button */
.view-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-view-toggle {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.btn-view-toggle:hover {
    background: linear-gradient(135deg, #9b59b6, #af7ac5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(142, 68, 173, 0.4);
}

.btn-view-toggle:active {
    transform: scale(0.98);
}

.toggle-icon {
    font-size: 1.2em;
}

.toggle-text {
    font-weight: 600;
}

/* Grid View */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-bottom: 20px;
}

.grid-item {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.grid-item:hover {
    transform: scale(1.05);
    border-color: #d4af37;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.grid-item:active {
    transform: scale(0.98);
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.grid-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 8px 6px 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grid-item:hover .grid-item-overlay {
    opacity: 1;
}

.grid-item-stats {
    display: flex;
    justify-content: space-around;
    font-size: 0.7em;
    color: white;
}

.grid-item-stats span {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Photo Modal */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5em;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(231, 76, 60, 0.9);
    transform: rotate(90deg);
}

.modal-content img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
}

.modal-info {
    padding: 20px;
    color: #333;
}

.modal-info h3 {
    margin-bottom: 10px;
    font-size: 1.3em;
    color: #2d5016;
}

.modal-info p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.modal-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    margin-bottom: 15px;
    font-weight: bold;
}

.modal-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

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

.modal-dislike {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
}

.modal-dislike:hover {
    background: linear-gradient(45deg, #ee5a24, #d63031);
}

.modal-like {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
}

.modal-like:hover {
    background: linear-gradient(45deg, #27ae60, #229954);
}

.modal-superlike {
    background: linear-gradient(45deg, #3498db, #2980b9);
}

.modal-superlike:hover {
    background: linear-gradient(45deg, #2980b9, #1f618d);
}

/* Community Post Badge in Grid */
.grid-item.community-post::before {
    content: '🌲';
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(255, 69, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.8em;
    z-index: 2;
}

/* Mobile Responsive for Grid */
@media (max-width: 480px) {
    .grid-container {
        gap: 8px;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }
}
