/* 
 * Exam View Styles
 * For iseraj.com
 */

:root {
  /* Primary color palette */
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --primary-light: #e1f0fa;

  /* Secondary color palette */
  --secondary-color: #2ecc71;
  --secondary-dark: #27ae60;
  --secondary-light: #e8f8f1;

  /* Accent colors */
  --accent-color: #e74c3c;
  --accent-dark: #c0392b;
  --accent-light: #faeae8;

  /* Neutral colors */
  --background-color: #f5f7fa;
  --card-bg: #ffffff;
  --text-color: #34495e;
  --text-muted: #7f8c8d;
  --border-color: rgba(0, 0, 0, 0.1);

  /* UI elements */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Typography */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
}

/* Base styles */
body {
  font-family: "Tajawal", sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
}

/* Wrapper */
.exam-container {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all 0.3s ease;
  margin-bottom: 2rem;
}

.exam-container:hover {
  box-shadow: var(--shadow-lg);
}

/* Exam header */
.exam-header {
  background-color: var(--primary-color);
  color: white;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
}

.exam-header::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  transform: rotate(30deg);
}

.exam-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.uploader-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.uploader-info a {
  color: white;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.uploader-info a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Exam metadata */
.exam-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--border-color);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.meta-item:hover {
  transform: translateY(-2px);
}

.meta-icon {
  font-size: 1.2rem;
  color: var(--primary-color);
}

/* Tags section */
.tag-section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--primary-light);
}

.tag {
  display: inline-block;
  background-color: white;
  color: var(--primary-color);
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  font-size: var(--font-size-sm);
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--primary-light);
}

.tag:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Description section */
.description-section {
  padding: 2rem;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
}

.description-section h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

.description-section p {
  line-height: 1.6;
  margin-bottom: 1rem;
}

.description-section strong {
  color: var(--text-color);
  font-weight: 600;
}

/* Download section */
.download-section {
  padding: 2rem;
  text-align: center;
  background-color: var(--secondary-color);
  color: white;
  background-image: linear-gradient(
    135deg,
    var(--secondary-color),
    var(--secondary-dark)
  );
}

.download-button {
  background-color: white;
  color: var(--secondary-color);
  border: none;
  padding: 0.75rem 1.75rem;
  font-size: var(--font-size-lg);
  border-radius: 50px;
  transition: all 0.3s ease;
  font-weight: 600;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.download-button:hover {
  background-color: var(--secondary-dark);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

/* Rating section */
.rating-section {
  padding: 2rem;
  border-bottom: 1px solid var(--border-color);
  background-color: white;
}

.rating-section h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

.emoji-rating {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.emoji-icon {
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s ease;
  user-select: none;
}

.emoji-icon:hover,
.emoji-icon.active {
  opacity: 1;
  transform: scale(1.3);
  background-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
}
.emoji-icon.active::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid;
  border-color: inherit;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

/* Color coding for different emoji ratings */
.emoji-rating .emoji-icon[data-rating="1"] {
  color: #e74c3c;
}
.emoji-rating .emoji-icon[data-rating="2"] {
  color: #e67e22;
}
.emoji-rating .emoji-icon[data-rating="3"] {
  color: #f1c40f;
}
.emoji-rating .emoji-icon[data-rating="4"] {
  color: #2ecc71;
}
.emoji-rating .emoji-icon[data-rating="5"] {
  color: #3498db;
}

.rating-stats {
  margin-top: 1rem;
  text-align: center;
  color: var(--text-muted);
}

/* Comments section */
.comments-section {
  padding: 2rem;
  border-bottom: 1px solid var(--border-color);
  background-color: white;
}

.comments-section h4 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

#commentForm {
  margin-bottom: 2rem;
}

#commentForm textarea {
  border-radius: var(--radius-md);
  resize: vertical;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

#commentForm textarea:focus {
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
  border-color: var(--primary-color);
}

#commentForm button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

#commentForm button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.comment {
  background-color: var(--background-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.comment:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.comment-author {
  font-weight: 600;
  color: var(--primary-color);
}

.comment-date {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.comment-content {
  line-height: 1.6;
}

/* Related exams section */
.related-exams {
  padding: 2rem;
  border-bottom: 1px solid var(--border-color);
  background-color: white;
}

.related-exams h4 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.related-exam-card {
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.related-exam-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.related-exam-card .card-body {
  padding: 1.25rem;
}

.related-exam-card .card-title {
  font-size: var(--font-size-md);
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.related-exam-card .card-text {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* Share section */
.share-section {
  padding: 2rem;
  background-color: var(--accent-color);
  color: white;
  background-image: linear-gradient(
    135deg,
    var(--accent-color),
    var(--accent-dark)
  );
}

.share-section h4 {
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.share-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.share-button {
  background-color: white;
  color: var(--accent-color);
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  transition: all 0.2s ease;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.share-button:hover {
  background-color: var(--accent-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Report section */
.report-section {
  text-align: center;
  padding: 1.5rem;
  background-color: white;
}

.report-button {
  background-color: var(--background-color);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  transition: all 0.2s ease;
}

.report-button:hover {
  background-color: var(--text-muted);
  color: white;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.staggered-item:nth-child(1) {
  animation-delay: 0.05s;
}
.staggered-item:nth-child(2) {
  animation-delay: 0.1s;
}
.staggered-item:nth-child(3) {
  animation-delay: 0.15s;
}
.staggered-item:nth-child(4) {
  animation-delay: 0.2s;
}
.staggered-item:nth-child(5) {
  animation-delay: 0.25s;
}
.staggered-item:nth-child(6) {
  animation-delay: 0.3s;
}

/* Emoji rating specific styles */
.emoji-rating .emoji-icon[data-rating="1"] {
  color: #e74c3c;
}
.emoji-rating .emoji-icon[data-rating="2"] {
  color: #e67e22;
}
.emoji-rating .emoji-icon[data-rating="3"] {
  color: #f1c40f;
}
.emoji-rating .emoji-icon[data-rating="4"] {
  color: #2ecc71;
}
.emoji-rating .emoji-icon[data-rating="5"] {
  color: #3498db;
}

/* Alert styles */
.alert {
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: none;
}

.alert-danger {
  background-color: var(--accent-light);
  color: var(--accent-dark);
}

.alert-success {
  background-color: var(--secondary-light);
  color: var(--secondary-dark);
}

.alert-warning {
  background-color: #fcf8e3;
  color: #8a6d3b;
}

/* Modal styles */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  background-color: var(--primary-color);
  color: white;
  border-bottom: none;
  padding: 1.25rem 1.5rem;
}

.modal-title {
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
}

/* Form controls */
.form-control {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.form-control:focus {
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  border-color: var(--primary-color);
}

.form-select {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.form-select:focus {
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  border-color: var(--primary-color);
}

/* File type indicators */
.file-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.file-type-pdf {
  background-color: #ffebee;
  color: #e53935;
}

.file-type-docx {
  background-color: #e3f2fd;
  color: #1e88e5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .exam-title {
    font-size: var(--font-size-xl);
  }

  .meta-item {
    width: calc(50% - 0.5rem);
  }

  .download-button {
    width: 100%;
  }

  .share-buttons {
    flex-direction: column;
  }

  .share-button {
    width: 100%;
  }

  .emoji-rating {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
  }

  .emoji-icon {
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
    background-color: transparent;
    position: relative;
  }
}

@media (max-width: 576px) {
  .exam-header,
  .exam-meta,
  .tag-section,
  .description-section,
  .download-section,
  .rating-section,
  .comments-section,
  .related-exams,
  .share-section {
    padding: 1.5rem;
  }

  .meta-item {
    width: 100%;
  }

  .related-exam-card {
    margin-bottom: 1rem;
  }
}
