/* Styles pour FauxSocial */

/* Variables */
:root {
  --primary-color: #1877f2;
  --primary-hover: #166fe5;
  --secondary-color: #42b72a;
  --text-color: #1c1e21;
  --text-muted: #65676b;
  --bg-color: #f0f2f5;
  --card-bg: #ffffff;
  --border-color: #dddfe2;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --spacing: 16px;
}

/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--spacing);
}

.hidden {
  display: none !important;
}

/* Header */
.header {
  background-color: var(--primary-color);
  color: white;
  padding: var(--spacing) 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: bold;
}

.config-btn {
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
}

.config-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Cartes */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: var(--spacing);
  overflow: hidden;
}

.card-content {
  padding: var(--spacing);
}

/* Formulaire de publication */
.post-form {
  margin-top: var(--spacing);
}

.post-form-title {
  color: var(--primary-color);
  font-size: 18px;
  text-align: center;
  margin-bottom: var(--spacing);
}

textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  resize: none;
  font-family: inherit;
  font-size: 16px;
}

textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--spacing);
}

.form-tools {
  display: flex;
  gap: 8px;
}

/* Boutons */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 14px;
  transition: background-color 0.2s;
}

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

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

.btn-primary:disabled {
  background-color: #e4e6eb;
  color: #bcc0c4;
  cursor: not-allowed;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.btn-outline:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.btn-tool {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  background-color: transparent;
  padding: 8px 12px;
  border-radius: var(--radius);
}

.btn-tool:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Aperçu d'image */
.image-preview-container {
  position: relative;
  margin-bottom: var(--spacing);
}

.image-preview-container img {
  max-height: 300px;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius);
}

.remove-image-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Configuration API */
.api-config {
  margin-top: var(--spacing);
}

.form-group {
  margin-bottom: var(--spacing);
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 14px;
}

.text-small {
  font-size: 12px;
}

.text-muted {
  color: var(--text-muted);
}

/* Post */
.post {
  margin-top: var(--spacing);
}

.post-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 12px;
}

.post-user-info {
  display: flex;
  flex-direction: column;
}

.post-username {
  font-weight: 600;
}

.post-time {
  font-size: 12px;
  color: var(--text-muted);
}

.post-content {
  margin-bottom: 12px;
}

.post-content img {
  max-width: 100%;
  max-height: 400px;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius);
}

.post-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.post-stats {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 14px;
}

.like-icon {
  background-color: var(--primary-color);
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  margin-right: 4px;
}

.like-button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius);
  background-color: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}

.like-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.like-button.active {
  color: var(--primary-color);
  font-weight: 500;
}

/* Commentaires */
.comments {
  margin-top: var(--spacing);
}

.comments-title {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.comment {
  display: flex;
  margin-bottom: 12px;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 8px;
  flex-shrink: 0;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-content {
  display: flex;
  flex-direction: column;
}

.comment-bubble {
  background-color: #f0f2f5;
  border-radius: 18px;
  padding: 8px 12px;
  max-width: 100%;
}

.comment-username {
  font-weight: 600;
  font-size: 13px;
	color:black;
}

.comment-text {
  font-size: 14px;
	color:black;
}

.comment-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  margin-left: 8px;
}

/* Message d'accueil */
.welcome-message {
  text-align: center;
  padding: 48px 0;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
  margin-top: 32px;
}

.welcome-message h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.welcome-message p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Loader */
.loader {
  display: flex;
  padding: 16px;
}

.loader-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #e4e6eb;
  margin-right: 8px;
}

.loader-content {
  flex: 1;
}

.loader-line {
  height: 12px;
  background-color: #e4e6eb;
  border-radius: 6px;
  margin-bottom: 6px;
}

.loader-line:last-child {
  width: 70%;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

.loader-avatar, .loader-line {
  animation: pulse 1.5s infinite;
}

/* Footer */
.footer {
  text-align: center;
  padding: var(--spacing) 0;
  margin-top: 32px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }
  
  .card-content {
    padding: 12px;
  }
}
