/* Variables & Design Tokens */
:root {
    --primary: #f97316; /* Vibrant Orange */
    --primary-hover: #ea580c;
    --secondary: #3b82f6; /* Friendly Blue */
    --secondary-hover: #2563eb;
    --background: #fdf8f6;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --border: #e5e7eb;
    --error: #ef4444;
    --success: #22c55e;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Nunito', sans-serif;
    color: var(--text-main);
    background-color: var(--background);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Quicksand', sans-serif;
    line-height: 1.2;
    margin-bottom: 1rem;
}

/* Utilities */
.hidden {
    display: none !important;
}
.text-center {
    text-align: center;
}
.text-primary {
    color: var(--primary);
}

/* Hero Background */
.hero-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-size: cover;
    background-position: top center; /* Focus on the top where the dog is */
    background-repeat: no-repeat;
    z-index: -2;
}

/* Overlay gradient to blend hero into the background color */
.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(253, 248, 246, 0.1) 0%, rgba(253, 248, 246, 0.9) 50%, rgba(253, 248, 246, 1) 100%);
    z-index: -1;
}

/* Layout */
.page-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10rem 1.5rem 3rem; /* Increased top padding leaves space for dog */
    min-height: 100vh;
}

.main-content {
    width: 100%;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 10;
}

/* Logo Header */
.logo-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.brand-logo {
    max-height: 90px;
    width: auto;
    object-fit: contain;
    background: var(--card-bg);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.business-name-badge {
    display: inline-block;
    margin-top: 0.75rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--card-bg);
    padding: 4px 16px;
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Navigation Tabs */
.tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
    gap: 1rem;
    position: relative;
    z-index: 10;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-btn {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.6);
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-muted);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
}

.tab-btn:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, #fb923c 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

/* Card Style */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.paw-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--primary);
    animation: bounce 2s infinite ease-in-out;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    background: linear-gradient(135deg, var(--primary), #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 550px;
    margin: 0 auto;
}

/* Form Styles */
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: #fff;
    transition: all 0.2s ease;
    outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Custom File Upload UI */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    cursor: pointer;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-ui {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background-color: #fafafa;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.file-upload-wrapper:hover .file-upload-ui,
.file-upload-wrapper input:focus + .file-upload-ui {
    border-color: var(--secondary);
    background-color: #eff6ff;
    color: var(--secondary);
}

.file-name-display {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #fb923c 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
    margin-top: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-primary.voted {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    box-shadow: none !important;
}

.btn-secondary {
    background-color: var(--secondary);
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-secondary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

.spinner.text-center {
    width: 40px;
    height: 40px;
    border-width: 4px;
    border-color: rgba(0,0,0,0.1);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}
.alert-error {
    background-color: #fef2f2;
    color: var(--error);
    border: 1px solid #fecaca;
}

/* Success State */
.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: var(--success);
}

.share-panel {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.share-panel h3 {
    color: var(--text-main);
    font-size: 1.25rem;
}

.share-input-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.share-input-group input {
    flex: 1;
    background-color: #f3f4f6;
    border-color: var(--border);
    cursor: text;
}

.share-input-group button {
    width: auto;
    white-space: nowrap;
}

/* Gallery Grid Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.gallery-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.gallery-img-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 Aspect Ratio */
    background: #f3f4f6;
    cursor: pointer;
    overflow: hidden;
}

.gallery-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-img {
    transform: scale(1.05);
}

.gallery-card-content {
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.gallery-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
}

.gallery-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.gallery-votes {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary);
}

.btn-vote {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-vote:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-vote.voted,
.btn-vote:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.lightbox.hidden {
    opacity: 0;
    pointer-events: none;
}

.lightbox-content {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .lightbox-content {
        flex-direction: row;
    }
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(0,0,0,0.8);
}

.lightbox-img-container {
    flex: 1.5;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

#lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-info {
    flex: 1;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--background);
}

.lightbox-info h3 {
    font-size: 1.75rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.lightbox-desc {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.lightbox-desc p {
    margin-bottom: 0.5rem;
}

.lightbox-action {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

#lightbox-vote-btn {
    flex: 1;
}

.lightbox-vote-count {
    font-weight: 700;
    color: var(--secondary);
    font-size: 1.1rem;
}

/* Powered By Element */
#wbx-powered-by-slot {
    margin-top: auto;
    width: 100%;
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 640px) {
    .page-wrapper {
        padding-top: 8rem; /* Adjusted for mobile */
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .card {
        padding: 2rem 1.5rem;
    }
    .title {
        font-size: 2rem;
    }
    .share-input-group {
        flex-direction: column;
    }
    .share-input-group button {
        width: 100%;
    }
    .lightbox-content {
        max-height: 95vh;
    }
    .lightbox-info {
        padding: 1.5rem;
    }
}