/* === RESET & VARIABLES === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #fafafa;
  --card-bg: #fff;
  --border-color: #dbdbdb;
  --text-color: #262626;
  --text-light: #8e8e8e;
  --primary-color: #0095f6;
  --error-color: #ed4956;
  --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --max-width: 600px;
}

/* === GLOBAL === */
html {
  font-size: 16px;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}

a {
  color: var(--text-color);
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* === CONTAINERS === */
header,
main {
  width: 100%;
  max-width: var(--max-width);
}

header {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  margin-bottom: 20px;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

nav a {
  padding: 6px 12px;
  border-radius: 4px;
  transition: background .2s;
}

nav a:hover {
  background: var(--border-color);
}

/* === BUTTONS === */
.btn {
  cursor: pointer;
  font-size: 0.9rem;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: var(--primary-color);
  color: #fff;
  transition: background .2s;
}

.btn:hover {
  background: darken(var(--primary-color), 10%);
}

.btn-like {
  background: transparent;
  color: var(--text-light);
  font-size: 1rem;
  display: flex;
  align-items: center;
  border: none;
}

.btn-like.liked {
  color: var(--error-color);
}

.btn-like .count {
  margin-left: 4px;
  font-size: 0.9rem;
}

.btn-follow {
  background: var(--primary-color);
  font-size: 0.8rem;
  padding: 4px 8px;
}

.btn-follow.following {
  background: #fff;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

/* === UPLOAD FORM === */
.upload {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.upload form {
  display: flex;
  flex-direction: column;
}

.upload input[type="file"] {
  margin-bottom: 10px;
}

.upload textarea {
  resize: vertical;
  min-height: 60px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: var(--font-family);
}

/* === FEED & POSTS === */
.feed {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 20px;
}

.post {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
}

.post-user strong {
  margin-right: 8px;
}

.post-user time {
  color: var(--text-light);
  font-size: 0.8rem;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post img {
  width: 100%;
  height: auto;
}

.caption {
  padding: 12px;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* === SEARCH === */
.search-form {
  display: flex;
  width: 100%;
  margin-bottom: 20px;
}

.search-form input[type="text"] {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px 0 0 4px;
}

.search-form button {
  border-radius: 0 4px 4px 0;
}

/* User list in search */
.user-results ul {
  list-style: none;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

/* === PROFILE PAGE === */
.profile-info {
  background: var(--card-bg);
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-align: center;
  margin-bottom: 20px;
}

.profile-pic img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  margin-bottom: 10px;
}

.profile-pic form {
  margin-top: 10px;
}

/* Notifications, Moderation, Connections sections */
.notifications,
.moderation,
.connections {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.notifications ul,
.moderation ul,
.connections ul {
  list-style: none;
}

.notifications li,
.moderation li,
.connections li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.btn-delete-comment {
  background: transparent;
  color: var(--error-color);
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
}

.slider {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: 100%; /* ratio 1:1 */
}
.slider .slides {
  display: flex;
  transition: transform 0.3s ease;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}
.slider .slides img {
  width: 100%; flex-shrink: 0;
  object-fit: cover;
}
.slider button.prev,
.slider button.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.3);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  padding: 0.2em 0.5em;
  cursor: pointer;
  z-index: 2;
}
.slider button.prev { left: 5px; }
.slider button.next { right: 5px; }


/* Réduction générale des boutons */
.btn {
  font-size: 0.85rem;
  padding: 4px 8px;
}

.btn-like,
.btn-follow,
.btn-edit-post,
.btn-delete-post {
  font-size: 0.85rem;
  padding: 4px 6px;
}

/* Flèches du slider plus discrètes */
.slider button.prev,
.slider button.next {
  font-size: 1.2rem;
  padding: 0.1em 0.4em;
}

/* Optionnel : espacement interne sur .post-actions pour éviter boutons collés */
.post-actions {
  gap: 6px;
}


/* === RESPONSIVE === */
@media (min-width: 600px) {
  .feed {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}
