/* Events Page Styles */

/* Page Header */
.page-header {
  padding: 60px 0;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  border-radius: 20px;
  margin-bottom: 0;
}

.page-title {
  font-size: 3rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Event Categories */
.event-categories {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.category-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
  box-shadow: 0 15px 35px rgba(var(--primary-rgb), 0.2);
}

.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.category-card:hover::before {
  left: 100%;
}

.category-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.category-card h5 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.category-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.category-count {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* View Toggle */
.view-toggle {
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.view-toggle .btn {
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-right: 1px solid var(--border-color);
}

.view-toggle .btn:last-child {
  border-right: none;
}

.view-toggle .btn.active {
  background: var(--primary-color);
  color: white;
}

.view-toggle .btn:hover:not(.active) {
  background: var(--hover-bg);
}

/* Filter Section */
.filter-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.search-box .input-group-text {
  background: var(--input-bg);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.search-box .form-control {
  background: var(--input-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.search-box .form-control:focus {
  background: var(--input-bg);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
  color: var(--text-primary);
}

.form-select {
  background: var(--input-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.form-select:focus {
  background: var(--input-bg);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
  color: var(--text-primary);
}

/* Quick Stats */
.quick-stats {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
}

.stat-item {
  padding: 1rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Active Filters */
.active-filters {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
}

.active-filters h6 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.active-filters .badge {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
}

/* Events View */
.events-view {
  display: none;
}

.events-view.active {
  display: block;
}

/* Event Cards */
.event-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
}

.event-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.event-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.event-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.event-card:hover .event-image img {
  transform: scale(1.05);
}

.event-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.event-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.event-content {
  padding: 1.5rem;
}

.event-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.event-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.event-meta {
  margin-bottom: 1rem;
}

.event-meta-item {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.event-meta-item i {
  color: var(--primary-color);
  width: 20px;
  margin-right: 0.5rem;
}

.event-countdown {
  background: var(--warning-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
}

.event-countdown i {
  margin-right: 0.5rem;
}

.event-actions {
  display: flex;
  gap: 0.5rem;
}

.event-actions .btn {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Calendar View */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.5rem;
}

.calendar-header h4 {
  color: var(--text-primary);
  margin: 0;
  font-weight: 600;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.calendar-day-header {
  background: var(--card-bg);
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.calendar-day {
  background: var(--card-bg);
  min-height: 120px;
  padding: 0.5rem;
  position: relative;
}

.calendar-day.empty {
  background: var(--surface-color);
}

.calendar-day-number {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.calendar-event {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  margin-bottom: 0.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.calendar-event:hover {
  background: var(--primary-dark);
  transform: scale(1.02);
}

.calendar-event i {
  margin-right: 0.25rem;
}

.calendar-event.tournament {
  background: var(--success-color);
}

.calendar-event.promotion {
  background: var(--info-color);
}

.calendar-event.special {
  background: var(--warning-color);
}

.calendar-event.challenge {
  background: var(--danger-color);
}

/* Sidebar Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: none;
}

.card-header {
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
}

.card-title {
  color: var(--text-primary);
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* Featured Events */
.featured-event-item {
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0.5rem;
  border-radius: 8px;
}

.featured-event-item:hover {
  background: var(--hover-bg);
}

.featured-event-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
}

.featured-event-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-event-content {
  flex: 1;
}

.featured-event-title {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.featured-event-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.featured-event-meta {
  font-size: 0.8rem;
}

/* Upcoming Deadlines */
.deadline-item {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.deadline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.deadline-title {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.deadline-time .badge {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
}

/* Tips List */
.tips-list {
  padding: 0;
}

.tip-item {
  display: flex;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.5;
}

.tip-item i {
  margin-top: 0.1rem;
}

.tip-item small {
  color: var(--text-secondary);
}

/* Event Detail Modal */
.event-detail-image img {
  border-radius: 12px;
  max-height: 300px;
  width: 100%;
  object-fit: cover;
}

.event-detail-info h6 {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.event-detail-info p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.event-rules,
.event-requirements {
  background: var(--surface-color);
  border-radius: 8px;
  padding: 1rem;
}

.event-rules p,
.event-requirements p {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* No Events */
.no-events {
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.no-events i {
  opacity: 0.5;
}

.no-events h5 {
  color: var(--text-primary);
  margin-top: 1rem;
}

/* Pagination */
.pagination .page-link {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
}

.pagination .page-link:hover {
  background: var(--hover-bg);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.pagination .page-item.active .page-link {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.pagination .page-item.disabled .page-link {
  background: var(--surface-color);
  border-color: var(--border-color);
  color: var(--text-muted);
}

/* Status Filter */
.status-filter .form-select {
  min-width: 150px;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
}

.loading-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-content p {
  color: var(--text-secondary);
  margin: 0;
}

/* Telegram Bot Promo Styles */
.telegram-promo-card {
  border: 2px solid #0088cc !important;
  box-shadow: 0 4px 20px rgba(0, 136, 204, 0.15);
  animation: telegramPulse 3s infinite;
}

@keyframes telegramPulse {
  0%,
  100% {
    box-shadow: 0 4px 20px rgba(0, 136, 204, 0.15);
  }
  50% {
    box-shadow: 0 8px 30px rgba(0, 136, 204, 0.25);
  }
}

.bg-telegram {
  background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%) !important;
}

.telegram-icon {
  font-size: 4rem;
  color: #0088cc;
  animation: telegramBounce 2s infinite;
}

@keyframes telegramBounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.telegram-features {
  background: rgba(0, 136, 204, 0.1);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid rgba(0, 136, 204, 0.2);
}

.feature-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.feature-item:last-child {
  margin-bottom: 0;
}

.feature-item i {
  color: #00d4aa;
}

.telegram-commands {
  background: rgba(0, 136, 204, 0.1);
  border: 1px solid rgba(0, 136, 204, 0.3);
  border-radius: 8px;
  padding: 1rem;
}

.telegram-commands h6 {
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.command-list {
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.command-list code {
  background: #0088cc;
  color: white;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  margin-right: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 136, 204, 0.3);
}

.btn-telegram {
  background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%);
  border: none;
  color: white;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-telegram:hover {
  background: linear-gradient(135deg, #0066aa 0%, #004488 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 136, 204, 0.3);
}

.btn-outline-telegram {
  border: 2px solid #0088cc;
  color: #0088cc;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-outline-telegram:hover {
  background: #0088cc;
  border-color: #0088cc;
  color: white;
  transform: translateY(-2px);
}

.telegram-steps {
  background: rgba(0, 136, 204, 0.1);
  border: 1px solid rgba(0, 136, 204, 0.3);
  border-radius: 8px;
  padding: 1rem;
}

.telegram-steps h6 {
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.steps-list {
  margin: 0;
  padding-left: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  line-height: 1.6;
}

.steps-list li {
  margin-bottom: 0.5rem;
}

.steps-list code {
  background: #0088cc;
  color: white;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.8rem;
  box-shadow: 0 1px 3px rgba(0, 136, 204, 0.3);
}

/* Giveaway Category Styles */
.calendar-event.giveaway {
  background: #ff6b6b;
}

.category-card[data-category="giveaway"] .category-icon {
  color: #ff6b6b;
}

.category-card[data-category="giveaway"]:hover {
  border-color: #ff6b6b;
  box-shadow: 0 15px 35px rgba(255, 107, 107, 0.2);
}

/* Enhanced Event Card for Giveaways */
.event-card[data-category="giveaway"] {
  border-left: 4px solid #ff6b6b;
}

.event-card[data-category="giveaway"] .event-category {
  background: rgba(255, 107, 107, 0.9);
}

.event-card[data-category="giveaway"]:hover {
  border-color: #ff6b6b;
  box-shadow: 0 20px 40px rgba(255, 107, 107, 0.15);
}

/* Telegram Connection Status */
.telegram-status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.telegram-status.connected {
  background: #d4edda;
  color: #155724;
}

.telegram-status.not-connected {
  background: #f8d7da;
  color: #721c24;
}

.telegram-status i {
  margin-right: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .page-title {
    font-size: 2rem;
  }

  .page-subtitle {
    font-size: 1rem;
  }

  .category-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
  }

  .category-icon {
    font-size: 2.5rem;
  }

  .filter-section {
    padding: 1rem;
  }

  .filter-section .row > div {
    margin-bottom: 1rem;
  }

  .event-card {
    margin-bottom: 1rem;
  }

  .event-content {
    padding: 1rem;
  }

  .event-actions {
    flex-direction: column;
  }

  .calendar-day {
    min-height: 80px;
    padding: 0.25rem;
  }

  .calendar-event {
    font-size: 0.6rem;
    padding: 0.15rem 0.3rem;
  }

  .view-toggle {
    width: 100%;
    margin-bottom: 1rem;
  }

  .quick-stats {
    margin-top: 1rem;
  }
}

@media (max-width: 576px) {
  .page-header {
    padding: 40px 0;
  }

  .page-title {
    font-size: 1.75rem;
  }

  .category-card {
    padding: 1rem;
  }

  .category-icon {
    font-size: 2rem;
  }

  .event-image {
    height: 150px;
  }

  .calendar-grid {
    font-size: 0.8rem;
  }

  .calendar-day {
    min-height: 60px;
  }

  .calendar-day-header {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
}
