/* Event Rating - Frontend Style */

/* Base Design Variables */
:root {
  --tger-text-white: #ffffff;
  --tger-text-orange: #d97706;
  --tger-bg-button-linear: linear-gradient(90deg, #eb5830 0%, #f4963d 100%);
  --tger-text-blue: #003767;
  --tger-text-orange-dark: #bf5427;
  --tger-bg-card: rgba(255, 255, 255, 0.85);
  --tger-border-color: rgba(229, 231, 235, 0.5);
  --tger-text-blue-dark: #1f2937;
  --tger-text-light: #6b7280;
  --tger-success: #10b981;
  --tger-error: #ef4444;
  --tger-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --tger-shadow-hover:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Grid Container */
.tger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

/* Entry Card */
.tger-card {
  background: var(--tger-bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--tger-border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--tger-shadow);
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s;
  display: flex;
  flex-direction: column;
}

.tger-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--tger-shadow-hover);
}

/* Featured Image */
.tger-card-thumbnail {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f3f4f6;
}

.tger-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.tger-card:hover .tger-card-thumbnail img {
  transform: scale(1.05);
}

/* Contestant Badge */
.tger-workplace-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: var(--tger-text-white);
  padding: 4px 10px;
  border-radius: 9999px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Content Area */
.tger-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.tger-card-title {
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--tger-text-blue);
  line-height: 1.4;
}

.tger-contestant-name {
  color: var(--tger-text-blue);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tger-contestant-name::before {
  content: "\2014"; /* Em dash */
  color: var(--tger-text-blue);
}

.tger-shared-content {
  color: var(--tger-text-blue);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

/* Image Gallery */
.tger-gallery-slider {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

.tger-gallery-slider::-webkit-scrollbar {
  height: 4px;
}

.tger-gallery-slider::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 9999px;
}

.tger-gallery-slide {
  flex: 0 0 80px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition:
    border-color 0.2s,
    transform 0.2s;
}

.tger-gallery-slide:hover {
  transform: scale(1.05);
}

.tger-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lightbox Modal (Premium view) */
.tger-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
}

.tger-lightbox-content {
  max-width: 90%;
  max-height: 80%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.tger-lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  object-fit: contain;
}

.tger-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.2s;
}

.tger-lightbox-close:hover {
  opacity: 0.8;
  color: var(--tger-text-white);
}

/* Rating Interface Footer */
.tger-card-footer {
  border-top: 1px solid var(--tger-border-color);
  padding: 1.25rem 1.5rem;
  background: rgba(249, 250, 251, 0.5);
  border-radius: 0 0 16px 16px;
}

/* Star Rating Widget */
.tger-rating-widget {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.tger-stars-wrapper {
  display: flex;
  gap: 4px;
  direction: ltr;
}

.tger-star {
  color: var(--tger-text-light);
  cursor: pointer;
  transition:
    color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Hover & Active highlights */
.tger-star.hover,
.tger-star.active {
  color: var(--tger-text-orange);
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.tger-star:hover {
  transform: scale(1.25);
}

.tger-rating-summary {
  color: var(--tger-text-blue);
  font-weight: 500;
}

.tger-rating-average-val {
  font-weight: 700;
  color: var(--tger-text-blue);
}

/* Status Notifications / Loading */
.tger-rating-message {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  display: none;
  font-weight: 500;
  animation: tgerFadeIn 0.3s ease forwards;
}

.tger-rating-message.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--tger-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.tger-rating-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--tger-error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.tger-card.voted .tger-star {
  cursor: default;
}

.tger-card.voted .tger-star:hover {
  transform: none;
}

/* Spinner Loader */
.tger-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--tger-text-white);
  animation: tgerSpin 0.6s linear infinite;
}

.tger-loading .tger-spinner {
  display: inline-block;
}

@keyframes tgerSpin {
  to {
    transform: rotate(360deg);
  }
}

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

/* Submission Time Badge */
.tger-submission-time {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--tger-text-light);
  font-weight: 500;
}

.tger-submission-time .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
  color: var(--tger-text-blue);
}

/* Video Verification Modal */
.tger-video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
}

.tger-video-content {
  background: var(--tger-text-white);
  color: var(--tger-text-blue);
  border: 1px solid rgba(229, 231, 235, 0.6);
  border-radius: 20px;
  padding: 2rem;
  max-width: 560px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: tgerFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tger-video-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tger-text-blue);
  margin: 0 0 0.5rem 0;
}

.tger-video-instruction {
  color: var(--tger-text-light);
  margin: 0 0 1.5rem 0;
}

.tger-video-wrapper {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.tger-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tger-video-actions {
  display: flex;
  justify-content: center;
}

.tger-video-actions button {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

.tger-video-actions button:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

/* Read More Button styling */
.tger-read-more-wrapper {
  margin-top: auto;
  padding-top: 10px;
}

.tger-read-more-btn {
  background: var(--tger-bg-button-linear);
  border: none;
  color: var(--tger-text-white);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tger-read-more-btn:hover {
  background: var(--tger-text-blue);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
  transform: translateY(-1px);
}

/* Details Popup Modal */
.tger-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.tger-popup-box {
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.6);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  box-sizing: border-box;
  animation: tgerFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tger-popup-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 30px;
  font-weight: 300;
  text-decoration: none;
  color: var(--tger-text-light);
  line-height: 1;
  transition:
    color 0.2s,
    transform 0.2s;
}

.tger-popup-close-btn:hover {
  color: var(--tger-error);
  transform: scale(1.1);
}

.tger-popup-title {
  font-weight: 800;
  color: var(--tger-text-blue);
  margin: 0 0 0.75rem 0;
  line-height: 1.3;
}

.tger-popup-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--tger-text-light);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--tger-border-color);
}

.tger-popup-author {
  font-weight: 700;
  color: var(--tger-text-orange);
}

.tger-popup-workplace {
  font-weight: 600;
  color: var(--tger-text-blue);
}

.tger-popup-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tger-popup-time .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

.tger-popup-body-content {
  font-size: 14px;
  color: var(--tger-text-blue);
  margin-bottom: 2rem;
  text-align: justify;
  font-weight: 500;
  line-height: 1.4;
}

.tger-popup-body-content p {
  margin-bottom: 1.25rem;
}

.tger-popup-body-content p:last-child {
  margin-bottom: 0;
}

/* Popup Image Gallery Layouts */
.tger-popup-gallery {
  margin-top: 1.5rem;
}

.tger-popup-gallery-one-col {
  display: block;
  max-width: 100%;
}

.tger-popup-gallery-one-col .tger-popup-gallery-item {
  width: 100%;
  max-height: 400px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.tger-popup-gallery-one-col .tger-popup-gallery-item img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.tger-popup-gallery-one-col .tger-popup-gallery-item img:hover {
  transform: scale(1.02);
}

.tger-popup-gallery-two-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.tger-popup-gallery-two-cols .tger-popup-gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.tger-popup-gallery-two-cols .tger-popup-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.tger-popup-gallery-two-cols .tger-popup-gallery-item img:hover {
  transform: scale(1.05);
}

/* Responsive Styles */
@media (max-width: 640px) {
  .tger-popup-gallery-two-cols {
    grid-template-columns: 1fr;
  }

  .tger-popup-box {
    padding: 1.5rem;
    max-height: 90vh;
  }

  .tger-popup-title {
    font-size: 1.4rem;
  }
}

/* Load More Pagination */
.tger-load-more-container {
  text-align: center;
  margin: 5rem 0;
}

.tger-load-more-btn {
  background: var(--tger-bg-button-linear);
  color: var(--tger-text-white);
  font-weight: 600;
  font-size: 14px;
  border: none;
  padding: 12px 32px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.tger-load-more-btn:hover {
  background: var(--tger-text-blue);
  color: var(--tger-text-white);
}

.tger-load-more-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: tgerSpin 0.6s linear infinite;
}

/* Disabled rating styles when voting is closed */
.tger-rating-widget.tger-voting-closed {
  pointer-events: none;
  opacity: 0.6;
}
.tger-rating-widget.tger-voting-closed .tger-star {
  cursor: not-allowed;
}
