/* public/assets/css/main.css */

/* ============================================
   VARIABLES & RESET
   ============================================ */
:root {
    --primary-red: #dc143c;
    --primary-red-dark: #b01030;
    --primary-red-light: #ff1744;
    --white: #ffffff;
    --black: #1a1a1a;
    --gray-50: #f9f9f9;
    --gray-100: #f0f0f0;
    --gray-200: #e0e0e0;
    --gray-300: #cccccc;
    --gray-600: #666666;
    --gray-800: #333333;
    
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'Courier New', monospace;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
}

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

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.site-header {
    background: var(--primary-red);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: var(--white);
    text-transform: uppercase;
}

.logo .city {
    font-weight: 300;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    padding: 5px 0;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
    border-bottom-color: var(--white);
}

/* Mobile menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-toggle { display: block; }
    
    .main-nav {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--primary-red-dark);
        padding: 20px;
        display: none;
    }
    
    .main-nav.active { display: block; }
    
    .main-nav ul {
        flex-direction: column;
        gap: 15px;
    }
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    background: var(--primary-red);
    color: var(--white);
    box-shadow: var(--shadow-md);
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--white);
}

.footer-nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

.footer-nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    border-bottom: 2px solid transparent;
    padding-bottom: 3px;
}

.footer-nav a:hover {
    border-bottom-color: var(--white);
}

.footer-copy {
    font-size: 14px;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-nav ul {
        flex-direction: column;
        gap: 10px;
    }
}

/* ============================================
   GALERIE PHOTOS
   ============================================ */
.gallery-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.gallery-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--black);
}

.gallery-filters {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    background: var(--gray-100);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-btn:hover {
    background: var(--gray-200);
}

.filter-btn.active {
    background: var(--white);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

/* Grid responsive */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   CARTE PHOTO
   ============================================ */
.photo-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    cursor: pointer;
}

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

.photo-card-image {
    position: relative;
    padding-top: 75%; /* Ratio 4:3 */
    overflow: hidden;
    background: var(--gray-100);
}

.photo-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

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

.photo-card-info {
    padding: 15px;
}

.photo-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--gray-600);
}

.photo-card-author {
    display: flex;
    align-items: center;
    gap: 5px;
}

.badge-pro {
    background: var(--primary-red);
    color: var(--white);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
}

.photo-card-stats {
    display: flex;
    gap: 15px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   MODAL PHOTO DÉTAIL
   ============================================ */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.photo-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.5);
}

.modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
}

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

/* Navigation swipe */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-nav:hover {
    background: rgba(255,255,255,0.4);
}

.modal-nav-prev { left: 20px; }
.modal-nav-next { right: 20px; }

.modal-sidebar {
    width: 400px;
    background: var(--white);
    height: 100%;
    overflow-y: auto;
    padding: 30px;
}

@media (max-width: 968px) {
    .modal-sidebar {
        position: absolute;
        bottom: 0;
        width: 100%;
        max-height: 50%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
}

/* ============================================
   BOUTONS
   ============================================ */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-red-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-800);
}

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-red);
    color: var(--primary-red);
}

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

/* ============================================
   FORMULAIRES
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-800);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: var(--font-primary);
    transition: var(--transition-fast);
}

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

.form-error {
    color: var(--primary-red);
    font-size: 14px;
    margin-top: 5px;
}

/* ============================================
   UPLOAD ZONE
   ============================================ */
.upload-zone {
    border: 3px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 60px 20px;
    text-align: center;
    background: var(--gray-50);
    transition: var(--transition-fast);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary-red);
    background: var(--white);
}

.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-red);
    transition: width var(--transition-normal);
}

/* ============================================
   PAGE PHOTO DÉTAIL (photo.php)
   ============================================ */
.post-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0 60px;
}

/* Fil d'Ariane */
.breadcrumb {
    padding: 15px 20px;
}

.breadcrumb a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition-fast);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Photo principale — pleine largeur viewport */
.post-photo {
    width: 100vw;
    margin-left: calc(50% - 50vw);
}

.post-photo__img {
    width: 100%;
    height: auto;
    display: block;
}

/* Métadonnées */
.post-meta {
    padding: 25px 20px 15px;
}

.post-meta__author {
    font-size: 15px;
    color: var(--gray-600);
    margin-bottom: 10px;
}

.post-meta__author strong {
    color: var(--gray-800);
}

.post-meta__description {
    font-size: 18px;
    color: var(--gray-800);
    margin-bottom: 12px;
    line-height: 1.5;
}

.post-meta__hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hashtag {
    display: inline-block;
    background: var(--gray-100);
    color: var(--primary-red);
    padding: 4px 12px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-fast);
}

.hashtag:hover {
    background: var(--primary-red);
    color: var(--white);
}

/* Likes */
.post-likes {
    padding: 10px 20px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.btn-like {
    background: none;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
}

.btn-like:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.btn-like--active {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: var(--white);
}

.btn-like--active:hover {
    background: var(--primary-red-dark);
    border-color: var(--primary-red-dark);
    color: var(--white);
}

#like-count {
    font-weight: 700;
    color: var(--gray-800);
}

/* Commentaires */
.post-comments {
    padding: 25px 20px;
}

.post-comments__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 20px;
}

.post-comments__title span {
    font-weight: 400;
    color: var(--gray-600);
}

/* Formulaire commentaire */
.comment-form {
    margin-bottom: 30px;
}

.comment-form__field {
    position: relative;
}

.comment-form__textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: var(--font-primary);
    resize: vertical;
    transition: var(--transition-fast);
}

.comment-form__textarea:focus {
    outline: none;
    border-color: var(--primary-red);
}

.comment-form__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.char-count {
    font-size: 13px;
    color: var(--gray-600);
}

/* Liste commentaires */
.comment {
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-100);
}

.comment__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.comment__author {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 15px;
}

.comment__date {
    font-size: 13px;
    color: var(--gray-600);
}

.comment__body {
    font-size: 15px;
    line-height: 1.5;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.comment__actions {
    display: flex;
    gap: 12px;
}

.btn-reply,
.btn-delete,
.btn-cancel {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 0;
}

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

.btn-reply:hover {
    text-decoration: underline;
}

.btn-delete {
    color: var(--gray-600);
}

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

.btn-cancel {
    color: var(--gray-600);
}

.btn-cancel:hover {
    color: var(--gray-800);
}

/* Réponses imbriquées (niveau 2) */
.comment__replies {
    margin-left: 30px;
    border-left: 2px solid var(--gray-200);
    padding-left: 20px;
}

.comment__replies .comment {
    border-bottom: 1px solid var(--gray-100);
}

.comment__replies .comment:last-child {
    border-bottom: none;
}

/* Responsive page photo */
@media (max-width: 768px) {
    .post-meta {
        padding: 20px 15px 10px;
    }

    .post-meta__description {
        font-size: 16px;
    }

    .post-likes {
        padding: 10px 15px 15px;
    }

    .post-comments {
        padding: 20px 15px;
    }

    .comment__replies {
        margin-left: 15px;
        padding-left: 12px;
    }
}