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

:root {
    --color-bg: #f9fafb;
    --color-surface: #ffffff;
    --color-text-main: #111827;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-primary: #e81f23;
    --color-primary-hover: #c4191d;
    --color-accent: #3b82f6;
    --color-error: #ef4444;
    --color-success: #10b981;
    
    --font-heading: "TradeGothicLTW04-Bold", sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-main);
    background-color: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

h2 {
    font-family: "TradeGothicLTW04-Bold", sans-serif;
}

p {
    font-family: "TradeGothicLTW04-Roman", sans-serif;
}

.hidden {
    display: none !important;
}

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.text-center { text-align: center; }

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 80px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 400px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-text-main);
    line-height: 1.1;
    margin-bottom: 20px;
}

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

.status-message {
    display: inline-block;
    margin-top: 24px;
    padding: 10px 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Tabs */
.main-app {
    margin-top: 2em;
    position: relative;
    z-index: 10;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    margin-bottom: 60px;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 16px;
}

.tab-btn {
    background: transparent;
    border: none;
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-text-muted);
    padding: 8px 16px;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.tab-btn:hover {
    color: var(--color-text-main);
}

.tab-btn.active {
    color: var(--color-text-main);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -17px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary);
    border-radius: 3px 3px 0 0;
}

.tab-content {
    display: none;
}

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

/* Forms */
.submit-photo-title {
    text-align: center;
    width: 100%;
    border-bottom: 1px solid #f6f6f6;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

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

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-text-main);
    font-size: 0.95rem;
}

.required {
    color: var(--color-error);
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text-main);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(232, 31, 35, 0.1);
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23111827' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Checkboxes */
.checkbox-group {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

.checkbox-text {
    display: flex;
    flex-direction: column;
}

.checkbox-label span {
    font-size: 0.95rem;
    color: var(--color-text-main);
}

.privacy-note {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* File Upload Visual */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    transition: border-color 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.file-upload-wrapper:hover,
.file-upload-wrapper.dragover {
    border-color: var(--color-primary);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-visual {
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-text-muted);
}

.file-upload-visual svg {
    margin-bottom: 12px;
    color: var(--color-primary);
}

.file-upload-visual small {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    opacity: 0.8;
}

.file-upload-preview {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.file-upload-preview img {
    max-height: 350px;
    width: 100%;
    object-fit: contain;
    background: #e5e7eb;
    display: block;
}

.preview-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-weight: 500;
}

.file-upload-wrapper:hover .preview-overlay {
    opacity: 1;
}

.error-message {
    background: #fef2f2;
    color: var(--color-error);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.95rem;
    border: 1px solid #fecaca;
}

/* Buttons */
.btn-primary, .btn-secondary {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary {
    background: white;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

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

.btn-block {
    width: 100%;
}

/* Post-Entry & Share */
.post-entry {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: #d1fae5;
    color: var(--color-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.post-entry h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.submitted-photo-preview {
    max-width: 300px;
    margin: 30px auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.submitted-photo-preview img {
    width: 100%;
    display: block;
}

.share-panel {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 30px;
    border: 1px solid var(--color-border);
}

.share-panel h3 {
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.share-controls {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.social-shares {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-social {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    color: white;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.btn-social:hover {
    opacity: 0.9;
}

.btn-social.fb { background: #1877F2; }
.btn-social.tw { background: #000000; }

/* Gallery */
.gallery-controls {
    margin-bottom: 24px;
    display: flex;
    justify-content: flex-end;
}

.gallery-controls select {
    width: 200px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.gallery-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

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

.card-img-wrap {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--color-bg);
}

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

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

.card-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-caption {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-author {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.btn-vote {
    background: transparent;
    border: 1px solid var(--color-border);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-vote:hover:not(.voted) {
    background: var(--color-bg);
    border-color: var(--color-text-muted);
}

.btn-vote.voted {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
    cursor: default;
}

.btn-vote.voted svg {
    fill: currentColor;
}

.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--color-border);
}

.gallery-empty svg {
    margin-bottom: 16px;
    color: var(--color-text-muted);
    opacity: 0.5;
}

.gallery-empty h3 {
    color: var(--color-text-main);
    margin-bottom: 8px;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
}

.lightbox-content {
    position: relative;
    z-index: 1001;
    width: 100%;
    max-width: 1200px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
}

.lightbox-body {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.lightbox-image-container {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 1;
    min-height: 300px;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.lightbox-info {
    padding: 24px;
    background: var(--color-surface);
}

.lightbox-info h3 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.lightbox-author {
    color: var(--color-text-muted);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.lightbox-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

#wbx-powered-by-slot {
    margin-top: 40px;
    width: 100%;
}

/* Language Toggle */
.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.lang-btn {
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px;
}

.lang-btn:hover {
    color: var(--color-text-main);
}

.lang-btn.active {
    color: var(--color-primary);
    text-decoration: underline;
}

body:not(.lang-fr) .langFR {
    display: none !important;
}

body.lang-fr .langEN {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .main-app {
        padding: 44px 16px 24px 16px;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .lightbox-content {
        padding: 0;
        flex-direction: column;
    }
    
    .lightbox-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
    }
    
    .lightbox-nav.prev { left: 10px; }
    .lightbox-nav.next { right: 10px; }
    
    .lightbox-body {
        border-radius: 0;
        max-height: 100vh;
    }
    
    .lightbox-image-container img {
        max-height: 60vh;
    }
}