* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s, color 0.3s;
  line-height: 1.6;
}

/* Mode clair par défaut */
body.light {
  background-color: #f5f5f5;
  color: #333;
}

body.dark {
  background-color: #121212;
  color: #eeeeee;
}

/* Container principal avec sidebars */
.container {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
}

/* Barre de langue / thème */
.lang-switch {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #333;
  color: white;
  padding: 10px 20px;
  text-align: right;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body.light .lang-switch {
  background-color: #e0e0e0;
  color: #000;
}

body.dark .lang-switch a {
  color: #fff;
}

body.light .lang-switch a {
  color: #000;
}

.lang-switch a {
  text-decoration: none;
  margin-left: 15px;
  font-weight: bold;
}

.lang-switch a:hover {
  text-decoration: underline;
}

/* Sidebars pour les annonces */
.sidebar {
  width: 160px;
  padding: 80px 10px 20px 10px;
  flex-shrink: 0;
}

.sidebar-left {
  order: 1;
}

.sidebar-right {
  order: 3;
}

.ad-sidebar {
  position: sticky;
  top: 80px;
  height: calc(100vh - 100px);
}

.ad-placeholder {
  background: linear-gradient(135deg, #e3e3e3, #f0f0f0);
  border: 2px dashed #ccc;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.9em;
  color: #666;
  border-radius: 8px;
}

body.dark .ad-placeholder {
  background: linear-gradient(135deg, #2a2a2a, #3a3a3a);
  border-color: #555;
  color: #aaa;
}

/* Contenu principal */
.main-content {
  flex: 1;
  padding: 80px 30px 20px 30px;
  order: 2;
  max-width: 800px;
}

header {
  margin-bottom: 30px;
  text-align: center;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.header-avatar {
  flex-shrink: 0;
}

.header-avatar img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #007acc;
  box-shadow: 0 4px 15px rgba(0,122,204,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header-avatar img:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0,122,204,0.4);
}

body.dark .header-avatar img {
  border-color: #66d9ef;
  box-shadow: 0 4px 15px rgba(102,217,239,0.3);
}

body.dark .header-avatar img:hover {
  box-shadow: 0 6px 20px rgba(102,217,239,0.4);
}

h1 {
  font-size: 2.5em;
  background: linear-gradient(45deg, #007acc, #0099ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

body.dark h1 {
  background: linear-gradient(45deg, #66d9ef, #88e5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  color: #007acc;
  border-bottom: 2px solid #007acc;
  padding-bottom: 10px;
  margin-top: 40px;
}

body.dark h2 {
  color: #66d9ef;
  border-bottom-color: #66d9ef;
}

section {
  background-color: #fff;
  padding: 30px;
  border-radius: 15px;
  transition: background-color 0.3s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

body.dark section {
  background-color: #1e1e1e;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Section À propos */
.about-section {
  margin-bottom: 20px;
}

.profile-info {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-avatar img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #007acc;
  box-shadow: 0 4px 15px rgba(0,122,204,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-avatar img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0,122,204,0.4);
}

body.dark .profile-avatar img {
  border-color: #66d9ef;
  box-shadow: 0 4px 15px rgba(102,217,239,0.3);
}

body.dark .profile-avatar img:hover {
  box-shadow: 0 6px 20px rgba(102,217,239,0.4);
}

.avatar-placeholder {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(45deg, #007acc, #0099ff);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8em;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(0,122,204,0.3);
}

body.dark .avatar-placeholder {
  background: linear-gradient(45deg, #66d9ef, #88e5ff);
  box-shadow: 0 4px 15px rgba(102,217,239,0.3);
}

.profile-text {
  flex: 1;
}

.profile-text p {
  margin-bottom: 15px;
}

/* Grille des projets */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  border: 1px solid #e0e0e0;
}

body.dark .project-card {
  background: #1a1a1a;
  border-color: #333;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.project-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

body.dark .project-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.card-image-container {
  height: 160px;
  background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #e0e0e0;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
}

body.dark .card-image-container {
  background: linear-gradient(135deg, #2a2a2a, #333);
  border-bottom-color: #444;
}

.card-image-placeholder {
  font-size: 3em;
  opacity: 0.8;
}

.card-content {
  padding: 20px;
}

.card-content h3 {
  margin: 0 0 10px 0;
  font-size: 1.3em;
  color: #007acc;
}

body.dark .card-content h3 {
  color: #66d9ef;
}

.card-content p {
  margin: 0 0 15px 0;
  color: #666;
  font-size: 0.95em;
}

body.dark .card-content p {
  color: #ccc;
}

.card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: #007acc;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 500;
}

body.dark .tag {
  background: #66d9ef;
  color: #000;
}

/* Section contact */
.contact-section {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 20px;
  border-radius: 10px;
  margin-top: 20px;
}

body.dark .contact-section {
  background: linear-gradient(135deg, #2a2a2a, #333);
}

.contact-section p {
  margin: 10px 0;
}

.contact-section a {
  color: #007acc;
  text-decoration: none;
  font-weight: 500;
}

.contact-section a:hover {
  text-decoration: underline;
}

body.dark .contact-section a {
  color: #66d9ef;
}

/* Bouton de thème */
.toggle-theme {
  cursor: pointer;
  padding: 8px 16px;
  border: 1px solid currentColor;
  border-radius: 20px;
  margin-left: 15px;
  background: none;
  font-size: 0.9em;
  color: inherit;
  transition: all 0.3s;
}

.toggle-theme:hover {
  background: currentColor;
  color: #fff;
}

body.dark .toggle-theme:hover {
  color: #000;
}

/* Media queries pour responsive */
@media (max-width: 1200px) {
  .sidebar {
    width: 120px;
  }
  
  .ad-placeholder {
    height: 400px;
    font-size: 0.8em;
  }
}

@media (max-width: 968px) {
  .container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    padding: 10px;
    order: unset;
  }
  
  .sidebar-left {
    order: 2;
  }
  
  .sidebar-right {
    order: 4;
  }
  
  .main-content {
    order: 3;
    padding: 80px 20px 20px 20px;
    max-width: none;
  }
  
  .ad-sidebar {
    position: static;
    height: auto;
  }
  
  .ad-placeholder {
    height: 120px;
    margin: 10px 0;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .lang-switch {
    padding: 10px 15px;
    font-size: 0.9em;
  }
  
  .main-content {
    padding: 80px 15px 20px 15px;
  }
  
  section {
    padding: 20px;
  }
  
  h1 {
    font-size: 2em;
  }
  
  .header-content {
    flex-direction: column;
    gap: 15px;
  }
  
  .header-avatar img {
    width: 50px;
    height: 50px;
  }
  
  .profile-info {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  
  .profile-avatar {
    margin-bottom: 15px;
  }
  
  .profile-avatar img,
  .avatar-placeholder {
    width: 60px;
    height: 60px;
  }
  
  .avatar-placeholder {
    font-size: 1.5em;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .project-card {
    margin: 0;
  }
}

@media (max-width: 480px) {
  .lang-switch {
    text-align: center;
    padding: 8px 10px;
  }
  
  .lang-switch span {
    display: block;
    margin-bottom: 5px;
  }
  
  .lang-switch a, .toggle-theme {
    margin: 0 5px;
  }
  
  .main-content {
    padding: 100px 10px 20px 10px;
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  .header-avatar img {
    width: 45px;
    height: 45px;
  }
  
  .profile-avatar img,
  .avatar-placeholder {
    width: 50px;
    height: 50px;
  }
  
  .avatar-placeholder {
    font-size: 1.2em;
  }
  
  .avatar-placeholder {
    width: 60px;
    height: 60px;
    font-size: 1.5em;
  }
}