/*
Theme Name: MidwayGPT Theme
Theme URI: https://midwaygpt.cyberinvestigation.fr
Description: Thème WordPress indépendant pour MidwayGPT - Plateforme éducative de galerie d'images IA
Version: 1.0
Author: Development Team
Author URI: https://midwaygpt.cyberinvestigation.fr
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: midwaygpt-theme
Domain Path: /languages
Requires at least: 5.0
Requires PHP: 7.2
*/

:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --dark-bg: #ffffff;
  --light-text: #1a1a1a;
  --border-color: #e0e0e0;
  --sidebar-bg: #f5f5f7;
  --hover-bg: #f0f0f0;
}

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

html, body {
  background-color: #ffffff;
  color: var(--light-text);
  font-family: 'ABC Diatype', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--secondary-color);
}

/* Sidebar Navigation */
.sidebar-nav {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  z-index: 999;
  transform: translateX(0);
  transition: transform 0.3s ease;
  overflow-y: auto;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
}

.sidebar-nav.closed {
  transform: translateX(-100%);
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 1.5rem 2rem 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
}

.sidebar-logo {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--primary-color);
  letter-spacing: 0.15em;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  padding: 0;
  text-transform: uppercase;
}

.sidebar-logo:hover {
  color: var(--secondary-color);
  opacity: 0.85;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  padding: 0;
}

.sidebar-close span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--light-text);
  margin: 6px 0;
  transition: all 0.3s ease;
  position: absolute;
  left: 0;
}

.sidebar-close span:first-child {
  transform: rotate(45deg);
  top: 12px;
}

.sidebar-close span:last-child {
  transform: rotate(-45deg);
  bottom: 12px;
}

.sidebar-menu {
  padding: 0;
  flex: 1;
}

.sidebar-menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
}

.sidebar-menu .nav-item {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-menu .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  margin: 0 0.75rem;
  color: var(--light-text) !important;
  background-color: transparent !important;
  transition: all 0.3s ease;
  font-weight: 400;
  font-size: 0.9375rem;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  position: relative;
}

.sidebar-menu .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary-color);
  border-radius: 0 2px 2px 0;
  transition: height 0.3s ease;
}

.sidebar-menu .nav-link span {
  display: flex;
  align-items: center;
}

.sidebar-menu .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.sidebar-menu .nav-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.5;
  transition: all 0.3s ease;
}

.sidebar-menu .nav-link:hover {
  color: var(--primary-color) !important;
  background-color: rgba(99, 102, 241, 0.08) !important;
  transform: translateX(4px);
}

.sidebar-menu .nav-link:hover::before {
  height: 60%;
}

.sidebar-menu .nav-link:hover .nav-icon {
  opacity: 1;
  transform: scale(1.1);
}

/* État actif pour la page courante */
.sidebar-menu .nav-item.active .nav-link {
  color: var(--primary-color) !important;
  background-color: rgba(99, 102, 241, 0.08) !important;
  font-weight: 500;
}

.sidebar-menu .nav-item.active .nav-link::before {
  height: 60%;
}

.sidebar-menu .nav-item.active .nav-link .nav-icon {
  opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.langue-select {
  width: 100%;
  max-width: 200px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: #666;
  background-color: #f5f5f7;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.langue-select:hover {
  border-color: var(--primary-color);
  background-color: #ebebed;
}

.langue-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Main Wrapper */
.main-wrapper {
  margin-left: 280px;
  transition: margin-left 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  background: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  width: 48px;
  height: 48px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-toggle:hover span {
  background-color: white;
}

.sidebar-toggle.show {
  display: flex;
}

.sidebar-toggle span {
  width: 25px;
  height: 2px;
  background-color: var(--light-text);
  transition: all 0.3s ease;
  display: block;
}

.sidebar-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(10px, 10px);
}

.sidebar-toggle.active span:nth-child(2) {
  opacity: 0;
}

.sidebar-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
}

/* Header */
header {
  background-color: var(--dark-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 2rem;
  max-width: 100%;
}

.site-logo {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo:hover {
  color: var(--secondary-color);
}

/* Main Content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

main {
  min-height: calc(100vh - 200px);
  padding: 3rem 0;
  background-color: var(--dark-bg);
  flex: 1;
}

/* Page Title */
main h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--light-text);
}

main > .container > .row > .col-12 > p:first-of-type {
  font-size: 1.1rem;
  color: #999;
  margin-bottom: 3rem;
  font-weight: 400;
}

/* Explorer Page */
.explorer-main {
  padding: 0 0 80px 0;
  max-width: 1200px;
  margin: 0 auto;
}

/* Create Section */
.create-section {
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
}

.create-wrapper {
  width: 100%;
  max-width: 100%;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  height: 56px;
}

.create-icon {
  font-size: 1.5rem;
  color: #9ca3af;
  font-weight: 300;
  flex-shrink: 0;
}

.create-input {
  flex: 1;
  border: none;
  padding: 0;
  font-size: 1rem;
  background-color: transparent;
  color: var(--light-text);
}

.create-input:focus {
  outline: none;
}

.create-input::placeholder {
  color: #d1d5db;
}

.create-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.create-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #9ca3af;
  padding: 0.5rem;
  transition: color 0.2s ease;
}

.create-action-btn:hover {
  color: var(--light-text);
}
}

/* Top Day Section */
.top-day-section {
  padding: 2rem 1rem 1.5rem 1rem;
  margin-bottom: 3rem;
}

.top-day-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--light-text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  margin: 2rem 0.25rem 2rem 0.25rem;
  padding-bottom: 2rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Coin haut gauche - première image */
.gallery-item:first-child {
  border-top-left-radius: 12px;
}

/* Coin haut droite - 4ème image (première ligne) */
.gallery-item:nth-child(4) {
  border-top-right-radius: 12px;
}

/* Coins du bas - calculés dynamiquement avec JavaScript ou CSS */
.gallery-item:nth-last-child(-n+4):nth-child(4n+1) {
  border-bottom-left-radius: 12px;
}

.gallery-item:nth-last-child(-n+4):nth-child(4n) {
  border-bottom-right-radius: 12px;
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1;
}

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

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.85), rgba(139, 92, 246, 0.85));
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  padding: 1.5rem;
  text-align: center;
}

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

.gallery-overlay-text {
  color: white;
  font-size: 0.9rem;
  line-height: 1.5;
  font-weight: 500;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 2rem 0 2rem;
  flex-wrap: wrap;
  align-items: center;
  padding: 2rem 0 0 0;
  border-top: 1px solid var(--border-color);
}

.pagination a,
.pagination span {
  padding: 0.5rem 0.75rem;
  min-width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--light-text);
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.pagination a:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.pagination .current {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  font-weight: 600;
}
}

/* Back Button */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #f5f5f7;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--light-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  margin-bottom: 2rem;
}

.back-button:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: translateX(-4px);
}

.back-button svg {
  transition: transform 0.3s ease;
}

.back-button:hover svg {
  transform: translateX(-4px);
}

/* Single Image Page */
.single-image-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.single-image-container {
  margin-top: 1rem;
}

.single-image-content {
  display: grid;
  grid-template-columns: 1fr 500px;
  gap: 3rem;
  align-items: start;
}

.single-image-column {
  position: sticky;
  top: 2rem;
}

.single-image-wrapper {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.single-image {
  width: 100%;
  height: auto;
  display: block;
}

.single-info-column {
  padding: 1rem 0;
}

.single-image-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--light-text);
  margin-bottom: 2rem;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.single-prompt-box {
  background: #f5f5f7;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  border-left: 4px solid var(--primary-color);
}

.prompt-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.prompt-text {
  font-size: 1rem;
  color: var(--light-text);
  line-height: 1.6;
  margin: 0;
}

.single-profile-box {
  margin-bottom: 2rem;
}

.profile-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: #f5f5f7;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.profile-card:hover {
  background: #ebebed;
  transform: translateY(-2px);
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.profile-card-static {
  cursor: default;
}

.profile-card-static:hover {
  background: #f5f5f7;
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.profile-card-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-color);
  flex-shrink: 0;
}

.profile-card-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.profile-card-avatar-initials span {
  line-height: 1;
}

.profile-card-info {
  flex: 1;
}

.profile-card-name {
  font-weight: 600;
  color: var(--light-text);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.profile-card-bio {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
  display: none;
}

@media (max-width: 1024px) {
  .single-image-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .single-image-column {
    position: relative;
    top: 0;
  }
}

/* Profile Page */
.profile-header {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  margin-bottom: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.profile-avatar {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  object-fit: cover;
  border: 3px solid var(--primary-color);
  flex-shrink: 0;
}

.profile-info h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--light-text);
}

.profile-info .subtitle {
  color: #999;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.profile-description {
  color: #666;
  line-height: 1.8;
  font-size: 1rem;
}

/* Centered Profile Header */
.profile-header-centered {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 2rem;
}

.profile-avatar-container {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.profile-avatar-centered {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary-color);
  box-shadow: 0 10px 40px rgba(99, 102, 241, 0.15);
}

.profile-name-centered {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--light-text);
  margin: 1rem 0 0.5rem 0;
  letter-spacing: -0.5px;
}

.profile-bio-centered {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.profile-description-centered {
  font-size: 1rem;
  color: #888;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

.profile-gallery-section {
  margin-top: 4rem;
}

.gallery-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--light-text);
  margin-bottom: 2rem;
  text-align: left;
}

/* Footer */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #f9f9f9;
  border-top: 1px solid var(--border-color);
  padding: 0.5rem 2.5rem;
  text-align: center;
  color: #999;
  z-index: 100;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.footer-separator {
  color: #ddd;
}

body {
  padding-bottom: 60px;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar-nav {
    width: 250px;
  }

  .main-wrapper {
    margin-left: 250px;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .image-modal-body {
    flex-direction: column;
  }

  .image-modal-info {
    width: 100%;
    max-width: 600px;
  }
}

@media (max-width: 768px) {
  .sidebar-nav {
    width: 280px;
    max-width: 280px;
    transform: translateX(-100%);
    z-index: 1001;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }

  .sidebar-nav.active {
    transform: translateX(0);
  }

  .sidebar-close {
    display: none;
  }

  .sidebar-nav.active .sidebar-close {
    display: block;
  }

  .sidebar-toggle.show {
    display: flex;
  }

  .sidebar-nav.active ~ .sidebar-toggle {
    display: none;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .back-button {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
  }

  header {
    padding-top: 4rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  main h1 {
    font-size: 1.8rem;
  }

  .profile-header {
    flex-direction: column;
    gap: 1.5rem;
  }

  .profile-avatar {
    width: 120px;
    height: 120px;
  }

  .profile-info h1 {
    font-size: 1.8rem;
  }
}

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

  main h1 {
    font-size: 1.5rem;
  }
}
