* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Tajawal", sans-serif;
  background: linear-gradient(135deg, #FDF7EC 0%, #E8F5E9 100%);
  color: #1B5E20;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* شعار دائري محسّن */
.logo-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid #2E7D32;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #FFFFFF 0%, #E8F5E9 100%);
  box-shadow: 0 6px 15px rgba(46, 125, 50, 0.15);
  animation: float 3s ease-in-out infinite;
  overflow: visible;
  padding: 8px;
  position: relative;
}

.logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* عناوين */
h1, h2, h3 {
  margin-top: 0;
  color: #1B5E20;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

/* زر رئيسي محسّن */
.btn-main {
  padding: 1rem 2.5rem;
  border-radius: 999px;
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #2E7D32 0%, #388E3C 100%);
  color: #fff;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-main::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-main:hover::before {
  width: 300px;
  height: 300px;
}

.btn-main:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(46, 125, 50, 0.4);
}

.btn-main:active {
  transform: translateY(-1px);
}

/* روابط عامة */
a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

/* رابط الرجوع محسّن */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  opacity: 0.8;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.back-link:hover {
  opacity: 1;
  background-color: rgba(46, 125, 50, 0.1);
}

/* إحصائيات */
.stats-container {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 150px;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #2E7D32;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  color: #666;
}

/* شبكة الكروت محسّنة */
.card-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (min-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: linear-gradient(135deg, #FFFFFF 0%, #F1F8E9 100%);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(46, 125, 50, 0.1), transparent);
  transition: left 0.5s;
}

.card:hover::before {
  left: 100%;
}

.card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px rgba(46, 125, 50, 0.2);
  border-color: #2E7D32;
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  display: block;
  transition: transform 0.3s ease;
}

.card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
}

.card h3 {
  margin: 0.5rem 0 0;
  font-size: 1.1rem;
}

/* معرض الصور محسّن */
.gallery-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-top: 1.5rem;
}

.gallery-item {
  background-color: #FFFFFF;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  cursor: default;
  position: relative;
  border: 2px solid transparent;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.gallery-item:hover .delete-btn {
  opacity: 1;
  transform: scale(1);
}

.delete-btn {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  z-index: 10;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  backdrop-filter: blur(4px);
}

.delete-btn:hover {
  background: #ff4444;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 68, 68, 0.4);
}

.delete-btn:active {
  transform: scale(0.95);
}

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

/* زر الإعجاب تحت الصورة */
.submission-like-btn-wrapper {
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid #f0f0f0;
}

.submission-like-btn {
  background: linear-gradient(135deg, #FFFFFF 0%, #F5F5F5 100%);
  border: 2px solid #E0E0E0;
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Tajawal", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
}

.submission-like-btn:hover {
  background: linear-gradient(135deg, #F5F5F5 0%, #EEEEEE 100%);
  border-color: #BDBDBD;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.submission-like-btn.liked {
  background: linear-gradient(135deg, #FFEBEE 0%, #FCE4EC 100%);
  border-color: #E91E63;
  color: #E91E63;
}

.submission-like-btn.liked:hover {
  background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

.submission-like-icon {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.submission-like-btn:hover .submission-like-icon {
  transform: scale(1.15);
}

.submission-like-btn.liked .submission-like-icon {
  animation: heartBeat 0.5s ease;
}

.submission-like-text {
  font-size: 0.85rem;
  color: #333;
}

.submission-like-btn.liked .submission-like-text {
  color: #E91E63;
}

.submission-like-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
  margin-right: 0.25rem;
}

.submission-like-btn.liked .submission-like-count {
  color: #E91E63;
}

.gallery-item-content {
  padding: 0.75rem;
}

.gallery-item p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #333;
}

.gallery-item-date {
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.5rem;
}

.gallery-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #999;
  font-size: 1.1rem;
}

/* معلومات المشارك */
.participant-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}

.participant-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2E7D32 0%, #388E3C 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.participant-details {
  flex: 1;
  min-width: 0;
}

.participant-name {
  font-weight: 600;
  color: #1B5E20;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.participant-department {
  font-size: 0.8rem;
  color: #666;
}

.submission-comment {
  margin: 0.75rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #333;
}

.submission-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f0f0f0;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.submission-stats {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.stat-item {
  font-size: 0.85rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.star {
  font-size: 0.9rem;
  opacity: 0.3;
  transition: opacity 0.2s;
}

.star.filled {
  opacity: 1;
  filter: drop-shadow(0 0 2px rgba(255, 193, 7, 0.5));
}

.submission-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  background-color: #f0f0f0;
  transform: scale(1.1);
}

.share-btn:hover {
  background-color: #E3F2FD;
}

.rate-btn:hover {
  background-color: #FFF9C4;
}

/* نجوم التقييم القابلة للنقر */
.rating-stars {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.star-clickable {
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.3;
  filter: grayscale(100%);
}

.star-clickable:hover {
  transform: scale(1.15);
  opacity: 0.6;
  filter: grayscale(50%);
}

.star-clickable.filled {
  opacity: 1;
  filter: none;
  filter: drop-shadow(0 0 3px rgba(255, 193, 7, 0.5));
  color: #FFC107;
}

.star-clickable:hover ~ .star-clickable {
  opacity: 0.3;
  filter: grayscale(100%);
}

/* غلاف الصورة */
.gallery-item-image-wrapper {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 0.5rem;
}

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

.view-icon {
  font-size: 1rem;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.3rem;
  border-radius: 50%;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: pulse 2s infinite;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* زر الإعجاب تحت الصورة */
.submission-like-section {
  margin: 0.75rem 0;
  padding-top: 0.75rem;
  border-top: 1px solid #f0f0f0;
}

.like-btn-under-image {
  background: linear-gradient(135deg, #FFFFFF 0%, #F5F5F5 100%);
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Tajawal", sans-serif;
  font-size: 0.9rem;
  width: auto;
  margin: 0 auto;
  justify-content: center;
}

.like-btn-under-image:hover {
  background: linear-gradient(135deg, #F5F5F5 0%, #EEEEEE 100%);
  border-color: #BDBDBD;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.like-btn-under-image.liked {
  background: linear-gradient(135deg, #FFEBEE 0%, #FCE4EC 100%);
  border-color: #E91E63;
  color: #E91E63;
}

.like-btn-under-image.liked:hover {
  background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.like-icon-under {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.like-btn-under-image:hover .like-icon-under {
  transform: scale(1.2);
}

.like-btn-under-image.liked .like-icon-under {
  animation: heartBeat 0.5s ease;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1.1); }
  75% { transform: scale(1.2); }
}

.like-text-under {
  font-weight: 600;
  color: #333;
}

.like-btn-under-image.liked .like-text-under {
  color: #E91E63;
}

.like-count-under {
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
}

.like-btn-under-image.liked .like-count-under {
  color: #E91E63;
}

/* قائمة المعجبين */
.likes-list {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: #F9F9F9;
  border-radius: 8px;
  font-size: 0.85rem;
}

.likes-list-header {
  font-weight: 600;
  color: #1B5E20;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.likes-list-names {
  color: #666;
  line-height: 1.6;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* شارة مميز */
.featured-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #1B5E20;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
  animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4); }
  50% { box-shadow: 0 2px 16px rgba(255, 215, 0, 0.8); }
}

.gallery-item.featured {
  border: 2px solid #FFD700;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

/* فلترة وترتيب */
.filter-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.sort-select {
  padding: 0.5rem 1rem;
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  font-family: "Tajawal", sans-serif;
  font-size: 0.9rem;
  background: white;
  color: #1B5E20;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sort-select:focus {
  outline: none;
  border-color: #2E7D32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.sort-select:hover {
  border-color: #2E7D32;
}

/* علامة مطلوب */
.required {
  color: #ff4444;
  font-weight: 700;
}

/* تقييم محسّن */
.rating {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #FFFFFF 0%, #F1F8E9 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.like-btn {
  cursor: pointer;
  user-select: none;
  font-size: 1.1rem;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.like-btn:hover {
  transform: scale(1.1);
}

.like-btn.liked {
  color: #E91E63;
}

#like-count {
  font-size: 1rem;
  font-weight: 600;
  color: #2E7D32;
}

/* مودال النموذج */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #FFFFFF;
  border-radius: 24px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
  position: relative;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background-color: #f0f0f0;
  color: #333;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #1B5E20;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #E0E0E0;
  border-radius: 12px;
  font-family: "Tajawal", sans-serif;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2E7D32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.file-upload-area {
  border: 2px dashed #2E7D32;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #F1F8E9;
}

.file-upload-area:hover {
  background-color: #E8F5E9;
  border-color: #1B5E20;
}

.file-upload-area.dragover {
  background-color: #C8E6C9;
  border-color: #2E7D32;
}

.file-upload-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.file-upload-text {
  color: #2E7D32;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.file-upload-hint {
  font-size: 0.85rem;
  color: #666;
}

#file-input {
  display: none;
}

.image-preview {
  margin-top: 1rem;
  display: none;
}

.image-preview.active {
  display: block;
}

.image-preview img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid #E0E0E0;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn-secondary {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: 2px solid #E0E0E0;
  font-size: 1rem;
  cursor: pointer;
  background: #FFFFFF;
  color: #666;
  transition: all 0.2s ease;
  flex: 1;
}

.btn-secondary:hover {
  background-color: #F5F5F5;
  border-color: #999;
}

.btn-submit {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #2E7D32 0%, #388E3C 100%);
  color: #fff;
  transition: all 0.2s ease;
  flex: 1;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* رسالة نجاح */
.success-message {
  background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  text-align: center;
  animation: slideDown 0.3s ease;
}

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

/* توسيط عمودي للصفحة الرئيسية */
.full-height-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

/* تحسينات للجوال */
@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-container {
    flex-direction: column;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  
  .modal-content {
    padding: 1.5rem;
  }
}