@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');
@import url("./Unils/splashScreen.css");

:root {
  --primary: #6C63FF;
  --secondary: #FF6584;
  --light: #F8F9FA;
  --dark: #343A40;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
}

body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  display: grid;
  place-items: center;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s;
}

a:hover {
  opacity: 0.8;
}

.message-sender {
  font-weight: bold;
  color: var(--primary);
}

.message-container {
  display: none;
  background-color: white;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 500px;
  padding: 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: popIn 0.6s forwards;
}

.message-header {
  margin-bottom: 30px;
}

.message-header h1 {
  color: var(--dark);
  margin-bottom: 10px;
}

.message-header p {
  color: #6c757d;
  font-size: 14px;
}

.user-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 20px;
  border: 5px solid white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  object-fit: cover;
  transition: all 0.5s;
}

.user-avatar:hover {
  transform: rotate(360deg);
}

.message-form {
  text-align: right;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--dark);
  font-weight: 500;
}

.btn {
  background: linear-gradient(to right, var(--primary), var(--secondary));
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
  box-shadow: 0 5px 15px rgba(108, 99, 255, 0.4);
  display: inline-flex;
  align-items: center;
}

.btn i {
  margin-left: 8px;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(108, 99, 255, 0.6);
}

.btn:active {
  transform: translateY(0);
}

.confirmation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: white;
  flex-direction: column;
  justify-content: center;
  display: flex;
  align-items: center;
  padding: 40px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s;
  transform: scale(0.8);
}

.confirmation.active {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}

.confirmation i {
  font-size: 60px;
  color: #4BB543;
  margin-bottom: 20px;
  animation: bounce 1s;
}

.confirmation h2 {
  color: var(--dark);
  margin-bottom: 10px;
}

.confirmation p {
  color: #6c757d;
  text-align: center;
  margin-bottom: 20px;
}

@keyframes popIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes float-up {
  0% {
    transform: translateY(100px) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* أنماط الـ Toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  background: #333;
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  animation: fadeInUp 0.3s;
}

.toast.success {
  background: #4CAF50;
}

.toast.error {
  background: #F44336;
}

.toast-close {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 0 0 0 10px;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* حالة الخطأ */
.error-container {
  text-align: center;
  padding: 2rem;
  max-width: 500px;
  margin: 0 auto;
}

.offline-warning {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #F44336;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
  display: none;
  z-index: 1000;
}

.hidden {
  display: none;
}

.ban-notification {
  background: linear-gradient(135deg, #ff4d4d 0%, #f94444 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  margin: 15px auto;
  max-width: 600px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(249, 68, 68, 0.2);
  animation: fadeInDown 0.5s ease-out;
  display: none;
}

.ban-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.ban-content {
  flex-grow: 1;
}

.ban-title {
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 1.1rem;
}

.ban-details {
  font-size: 0.9rem;
  opacity: 0.9;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  direction: ltr;
}

.formatting-tools {
  display: flex;
  gap: 3px;
}

.formatting-tools button {
  border: none;
  background-color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #6C63FF;
  cursor: pointer;
  transition: all 0.2s;
}

.formatting-tools button:hover {
  background: #eee;
}

.formatting-tools button.active {
  background: rgba(108, 99, 255, 0.1);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #6C63FF;
  cursor: pointer;
  transition: all 0.2s;
}

.format-btn-ZY {
  display: none;
}

.editor:empty::before {
  content: "اكتب رسالتك هنا...";
  color: #757575;
}

.editor {
  width: 100%;
  padding: 15px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 16px;
  min-height: 150px;
  resize: vertical;
  transition: all 0.3s;
  background-color: #f8f9fa;
}

.editor:focus {
  border-color: var(--primary);
  outline: none;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

blockquote {
  border-right: 3px solid #ccc;
  margin: 5px 0;
  padding-right: 10px;
  color: #666;
}

.toggle-name-option {
  margin-top: 12px;
  display: flex;
  column-gap: 10px;
  font-size: 14px;
  color: #333;  
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

/* عند التفعيل */
.switch input:checked + .slider {
  background-color: var(--primary);
}

.switch input:checked + .slider:before {
  transform: translateX(18px);
}


/* التكيف مع الشاشات الصغيرة */
@media (max-width: 480px) {
  .input-footer {
    margin-top: 8px;
    display: block;
    text-align: center;
  }

  .formatting-tools{
    margin-top: 0;
    align-items: center;
    display: inline-flex;
  }

  .message-container {
    border-radius: 0;
    width: 100%;
    min-height: 100vh;
  }

  .user-avatar {
    width: 80px;
    height: 80px;
  }

  h1 {
    font-size: large;
  }

  h3 {
    font-size: medium;
  }

  .btn {
    font-size: small;
    width: 100%;
    justify-content: center;
  }

  .editor {
    font-size: small;
  }

  .form-group * {
    font-size: small;
  }

  .toast {
    right: 1rem;
    left: 1rem;
    bottom: 1rem;
    max-width: unset;
    font-size: 0.85rem;
    padding: 0.75rem;
  }

  .format-btn-ZY {
    display: block;
  }

  .reply-content {
    font-size: 14px;
  }
}

#message {
  line-height: 1.5;
  word-break: break-word;
}

#message blockquote {
  border-right: 2px solid #ddd;
  margin: 8px 0;
  padding-right: 10px;
  color: #666;
}

.reply {
  margin-top: 10px;
  padding: 12px;
  background-color: #f1f3f5;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  animation: fadeIn 0.4s ease-in-out;
}

.reply-container {
  padding: 20px;
  border-radius: 10px;
  background-color: #f8f9fa;
  margin-bottom: 15px;
  transition: all 0.3s;
  animation: fadeIn 0.5s forwards;
  opacity: 0;
  direction: rtl;
  text-align: right;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}


.reply-sender {
  font-weight: bold;
  color: var(--primary);
}

.reply-date {
  color: #6c757d;
  font-size: 14px;
}

.reply-content {
  color: var(--dark);
  line-height: 1.6;
  align-self: start;
}

.floating-btn {
  display: flex;
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  color: white;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  box-shadow: 0 5px 20px rgba(108, 99, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s;
  z-index: 90;
  animation: pulse 2s infinite;
}

.floating-btn:hover {
  transform: scale(1.1);
}

#created{
  display: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(108, 99, 255, 0.7);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(108, 99, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(108, 99, 255, 0);
  }
}

.floating-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -100px;
    background: rgba(108, 99, 255, 0.1);
    border-radius: 50%;
    animation: float linear infinite;
}

.fas fa-shield-alt{
  color: var(--primary);
  display: none;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(-1000px) rotate(720deg);
        opacity: 0;
    }
}