@tailwind base;
@tailwind components;
@tailwind utilities;

/* --- Keep your existing styles here --- */

/* General Styles Improvement */
* {
  box-sizing: border-box; /* Ensures padding doesn't break layout widths */
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f0f2f5;
  color: #333;
}

header {
  background-color: #fff;
  color: #007bff;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

header h1 {
  margin: 0;
  flex-grow: 1;
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.3s ease;
}

.auth-btn:hover {
  background-color: #218838;
}

#user-status {
  font-size: 0.9em;
  color: #555;
}

h2 {
  color: #007bff;
}

main {
  max-width: 1000px;
  margin: 20px auto;
  padding: 0 15px;
}

.card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

/* E-Sports Live Scores Section Styles */
.score-filter-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.score-filter-controls input[type="date"] {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
  text-align: center;
}

.country-block {
  margin-top: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 15px;
}

.country-header {
  background-color: #007bff;
  color: white;
  padding: 10px 15px;
  font-size: 1.2em;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
}

.country-header .flag {
  font-size: 1.5em;
}

.tournament-block {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.tournament-header {
  font-weight: bold;
  color: #28a745;
  padding: 5px 15px;
  margin-top: 5px;
  font-size: 1.1em;
}

.match-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 15px;
  border-top: 1px dashed #f0f0f0;
  position: relative;
}

.match-teams {
  font-weight: 500;
  flex-grow: 1;
}

.match-score {
  font-weight: bold;
  color: #0056b3;
  min-width: 50px;
  text-align: center;
}

.match-time {
  font-size: 0.9em;
  color: #6c757d;
  min-width: 60px;
  text-align: right;
}

/* Blinking Light Animation */
@keyframes blink {
  0%,
  100% {
    opacity: 1;
    background-color: #28a745;
  }
  50% {
    opacity: 0.2;
    background-color: #28a745;
  }
}

.live-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
}

.live-indicator.blinking {
  animation: blink 1s linear infinite;
}

/* --- Comment Section Styles --- */
.comment-section-toggle {
  background-color: #f8f8f8;
  color: #333;
  border: none;
  padding: 5px 15px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-size: 0.9em;
  transition: background-color 0.2s;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comment-section-toggle:hover {
  background-color: #eee;
}

.comment-toggle-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out;
  padding: 0 15px;
  background-color: #fafafa;
}

.comment-content.active {
  max-height: 500px;
  padding: 15px;
}

.comment-item {
  padding: 8px 0;
  border-bottom: 1px dashed #e0e0e0;
  font-size: 0.9em;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85em;
  color: #007bff;
  margin-bottom: 5px;
}

.comment-author {
  font-weight: bold;
  margin-right: 5px;
}

.comment-time {
  color: #6c757d;
}

.comment-text {
  margin: 0;
  color: #333;
}

.comment-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 5px;
}

.like-button {
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
}

.like-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.like-button .fas.fa-heart {
  color: #dc3545;
}

/* Comment Form */
.comment-post-form {
  padding: 10px 0;
  border-top: 1px solid #eee;
  margin-top: 10px;
}

.comment-post-form textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
  min-height: 50px;
  margin-bottom: 5px;
  box-sizing: border-box;
}

.comment-post-form button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  float: right;
  margin-top: 5px;
  transition: background-color 0.2s;
}

.comment-post-form button:hover {
  background-color: #0056b3;
}

/* Live Broadcast Section Styles */
#live-broadcast-section .caption {
  font-style: italic;
  color: #6c757d;
  margin-bottom: 20px;
  text-align: center;
}

#live-streams-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.live-stream-item {
  background-color: #f8f9fa;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.live-stream-item a {
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-stream-item .fa-tv {
  color: #28a745;
  margin-left: 10px;
  font-size: 1.2em;
}

/* 3D moving images */
.box {
  position: relative;
  width: 50px;
  height: 50px;
  transform-style: preserve-3d;
  animation: animate 20s linear infinite;
  margin: 0 auto; /* Center for mobile */
}

@keyframes animate {
  0% {
    transform: perspective(1000px) rotateY(0deg);
  }
  100% {
    transform: perspective(1000px) rotateY(360deg);
  }
}

.box span {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: center;
  transform-style: preserve-3d;
  transform: rotateY(calc(var(--i) * 45deg)) translateZ(400px);
  -webkit-box-reflect: below 0px
    linear-gradient(transparent, transparent, #0004);
}

.box span img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  border: 2px solid white;
  border-radius: 18px;
  height: 100%;
  object-fit: cover;
}

/* --- RESPONSIVE MEDIA QUERY --- */

@media screen and (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  .auth-controls {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .score-filter-controls {
    flex-direction: column;
    gap: 10px;
  }

  .score-filter-controls input[type="date"] {
    width: 100%;
  }

  .match-item {
    flex-wrap: wrap;
    gap: 10px;
  }

  .match-teams {
    width: 100%; /* Force teams to take full width on tiny screens */
    margin-bottom: 5px;
  }

  .match-score,
  .match-time {
    font-size: 0.85em;
  }

  /* Shrink the 3D animation depth so it doesn't clip off the screen */
  .box span {
    transform: rotateY(calc(var(--i) * 45deg)) translateZ(150px);
  }

  .card {
    padding: 15px;
  }
}

/* Services Banner Styles */
#services-section {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  text-align: center;
  padding: 40px 20px;
}

#services-section h1 {
  margin-bottom: 20px;
  font-size: 1.8em;
}

.services-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.services-list li {
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 8px;
  font-size: 1em;
  line-height: 1.4;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
  .services-list {
    flex-direction: row;
    justify-content: center;
  }

  .services-list li {
    width: 30%; /* Side by side on larger screens */
  }
}
