/* ═══════════════════════════════════════════════════════════════
   📱 MOBILE DESIGN - FAMILLE EHRET
   ═══════════════════════════════════════════════════════════════ */

/* ─── Mobile Main Content ─── */
@media (max-width: 768px) {
  .main-content {
    padding: 16px;
    padding-top: 80px;
    padding-bottom: 100px; /* Space for bottom nav */
  }
  
  /* Hide desktop nav */
  .desktop-nav {
    display: none !important;
  }
  
  /* Show mobile nav */
  .mobile-nav {
    display: block;
  }
  
  /* Mobile typography */
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  /* ─── HOME PAGE MOBILE ─── */
  
  .home-hero {
    padding: var(--space-lg) 0;
    margin-bottom: var(--space-lg);
  }
  
  .home-hero h1 {
    font-size: 1.75rem;
  }
  
  .home-hero .tagline {
    font-size: 1rem;
  }
  
  .home-hero .subtitle {
    font-size: 0.95rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
  
  .stat-card {
    padding: var(--space-md);
  }
  
  .stat-icon {
    width: 48px;
    height: 48px;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .quick-actions {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .quick-action {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    text-align: left;
  }
  
  .quick-action-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    margin: 0;
  }
  
  .quick-action h3 {
    font-size: 1rem;
    margin-bottom: 2px;
  }
  
  .quick-action p {
    font-size: 0.85rem;
  }
  
  /* ─── PHOTO GRID MOBILE ─── */
  
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .photo-card {
    border-radius: 12px;
  }
  
  .photo-card-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 40%);
    padding: 12px;
  }
  
  .photo-card-info {
    font-size: 0.8rem;
  }
  
  .photo-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    top: 8px;
    right: 8px;
  }
  
  .photo-actions {
    top: 8px;
    left: 8px;
  }
  
  .photo-action-btn {
    width: 32px;
    height: 32px;
  }
  
  .photo-action-btn i {
    width: 16px;
    height: 16px;
  }
  
  /* ─── FILTERS MOBILE ─── */
  
  .filters-bar {
    flex-direction: column;
    padding: var(--space-md);
    gap: var(--space-md);
    border-radius: 12px;
  }
  
  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .filter-tabs::-webkit-scrollbar {
    display: none;
  }
  
  .filter-tab {
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 0.9rem;
  }
  
  .filter-search {
    width: 100%;
    margin-left: 0;
  }
  
  /* ─── UPLOAD PAGE MOBILE ─── */
  
  .upload-page {
    padding: 0;
  }
  
  .upload-header {
    text-align: center;
    margin-bottom: var(--space-lg);
  }
  
  .upload-header h1 {
    font-size: 1.5rem;
  }
  
  .upload-zone {
    border-radius: 16px;
    padding: var(--space-xl) var(--space-md);
  }
  
  .upload-zone-icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-md);
  }
  
  .upload-zone-icon i {
    width: 32px;
    height: 32px;
  }
  
  .upload-zone h3 {
    font-size: 1.25rem;
  }
  
  .upload-formats {
    margin-top: var(--space-md);
  }
  
  .upload-preview {
    border-radius: 12px;
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
  }
  
  .upload-preview h4 {
    font-size: 1rem;
  }
  
  .preview-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  .preview-item {
    border-radius: 8px;
  }
  
  .upload-form {
    border-radius: 12px;
    padding: var(--space-md);
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
  }
  
  .form-group {
    margin-bottom: var(--space-md);
  }
  
  .form-label {
    font-size: 0.9rem;
  }
  
  .form-input,
  .form-select {
    padding: 12px 14px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .btn-upload {
    padding: 14px;
    font-size: 1rem;
    border-radius: 12px;
  }
  
  /* ─── ALBUMS MOBILE ─── */
  
  .albums-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .album-card {
    border-radius: 12px;
  }
  
  .album-cover {
    height: 140px;
  }
  
  .album-body {
    padding: var(--space-md);
  }
  
  .album-title {
    font-size: 1.1rem;
  }
  
  .album-meta {
    font-size: 0.85rem;
  }
  
  /* ─── LIGHTBOX MOBILE ─── */
  
  .lightbox-content {
    padding: var(--space-md);
  }
  
  .lightbox-content img {
    max-height: 80vh;
    border-radius: 8px;
  }
  
  .lightbox-close {
    top: var(--space-md);
    right: var(--space-md);
    width: 44px;
    height: 44px;
  }
  
  .lightbox-nav {
    width: 44px;
    height: 44px;
  }
  
  .lightbox-prev { left: var(--space-sm); }
  .lightbox-next { right: var(--space-sm); }
  
  /* ─── AUTH MOBILE ─── */
  
  .auth-container {
    padding: var(--space-md);
  }
  
  .auth-card {
    padding: var(--space-lg);
    border-radius: 20px;
  }
  
  .auth-logo {
    font-size: 2.5rem;
  }
  
  .auth-title {
    font-size: 1.5rem;
  }
  
  .auth-subtitle {
    font-size: 0.95rem;
  }
  
  /* ─── TOAST MOBILE ─── */
  
  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    bottom: 110px;
  }
  
  .toast {
    width: 100%;
    padding: var(--space-md);
    border-radius: 12px;
  }
  
  /* ─── HOME SECTION MOBILE ─── */
  
  .home-section {
    margin-bottom: var(--space-lg);
  }
  
  .home-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
  }
  
  .home-section-title {
    font-size: 1.25rem;
  }
  
  .home-section-header .btn {
    width: 100%;
    justify-content: center;
    padding: 10px;
    font-size: 0.9rem;
  }
}

/* ─── Extra small screens ─── */
@media (max-width: 380px) {
  .photo-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .filter-tabs {
    flex-wrap: nowrap;
    gap: 8px;
  }
}

/* ─── Touch optimizations ─── */
@media (hover: none) and (pointer: coarse) {
  /* Touch-specific styles */
  .photo-card:hover {
    transform: none;
  }
  
  .stat-card:hover {
    transform: none;
  }
  
  .album-card:hover {
    transform: none;
  }
  
  .quick-action:hover {
    transform: none;
  }
  
  .btn:hover:not(:disabled) {
    transform: none;
  }
  
  /* Active states for touch */
  .mobile-nav .nav-item:active {
    opacity: 0.7;
  }
  
  .btn:active:not(:disabled) {
    opacity: 0.9;
    transform: scale(0.98);
  }
  
  /* Show actions on touch devices */
  .photo-card-overlay {
    opacity: 1;
  }
  
  .photo-card-actions {
    opacity: 1;
  }
}

/* ─── Safe area for iPhone X+ ─── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  
  .main-content {
    padding-bottom: max(100px, calc(80px + env(safe-area-inset-bottom)));
  }
  
  .toast-container {
    bottom: max(110px, calc(100px + env(safe-area-inset-bottom)));
  }
}

/* ─── Long press for selection ─── */
@media (hover: none) and (pointer: coarse) {
  .photo-card.selected {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
  }
  
  .photo-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-dark);
  }
}

/* ─── Swipe gestures container ─── */
.swipe-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
}

.swipe-container::-webkit-scrollbar {
  display: none;
}

.swipe-item {
  scroll-snap-align: start;
  flex-shrink: 0;
}