/**
 * Enhanced Subscription Countdown Styles
 * Provides visual styling for the real-time countdown timer
 */

/* Main countdown container */
.remaining-time {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 20px;
  margin: 15px 0;
  border: 2px solid #dee2e6;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.remaining-time::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #28a745, #20c997);
  transition: all 0.3s ease;
}

/* Countdown header */
.countdown-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.countdown-icon {
  font-size: 18px;
  color: #6c757d;
}

.countdown-header .label {
  font-weight: 600;
  color: #495057;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Main countdown display */
.countdown-display {
  text-align: center;
}

.countdown-value {
  font-size: 24px;
  font-weight: 700;
  color: #28a745;
  display: block;
  margin-bottom: 10px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}

/* Detailed breakdown */
.countdown-breakdown {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  color: #6c757d;
  min-width: 40px;
}

.time-unit strong {
  font-size: 16px;
  font-weight: 700;
  color: #495057;
  display: block;
  margin-bottom: 2px;
}

/* Urgency levels */
.countdown-normal {
  border-color: #28a745;
}

.countdown-normal::before {
  background: linear-gradient(90deg, #28a745, #20c997);
}

.countdown-normal .countdown-value {
  color: #28a745;
}

.countdown-caution {
  border-color: #ffc107;
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.countdown-caution::before {
  background: linear-gradient(90deg, #ffc107, #ffb347);
}

.countdown-caution .countdown-value {
  color: #856404;
}

.countdown-caution .countdown-icon {
  color: #856404;
}

.countdown-warning {
  border-color: #fd7e14;
  background: linear-gradient(135deg, #ffe8d1 0%, #ffd19a 100%);
  animation: pulse-warning 2s infinite;
}

.countdown-warning::before {
  background: linear-gradient(90deg, #fd7e14, #ff6b35);
}

.countdown-warning .countdown-value {
  color: #d63384;
}

.countdown-warning .countdown-icon {
  color: #d63384;
}

.countdown-critical {
  border-color: #dc3545;
  background: linear-gradient(135deg, #f8d7da 0%, #f1aeb5 100%);
  animation: pulse-critical 1s infinite;
}

.countdown-critical::before {
  background: linear-gradient(90deg, #dc3545, #c82333);
}

.countdown-critical .countdown-value {
  color: #721c24;
  animation: blink 1s infinite;
}

.countdown-critical .countdown-icon {
  color: #721c24;
}

.countdown-expired {
  border-color: #6c757d;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  opacity: 0.7;
}

.countdown-expired::before {
  background: #6c757d;
}

.countdown-expired .countdown-value {
  color: #6c757d;
}

/* Urgency warning */
.urgency-warning {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(220, 53, 69, 0.1);
  border-radius: 6px;
  color: #721c24;
  font-size: 12px;
  font-weight: 600;
  animation: shake 0.5s ease-in-out infinite alternate;
}

.warning-icon {
  font-size: 14px;
  animation: rotate 2s linear infinite;
}

/* Animations */
@keyframes pulse-warning {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(253, 126, 20, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(253, 126, 20, 0);
  }
}

@keyframes pulse-critical {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
  }
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0.5;
  }
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(2px);
  }
}

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

/* SubscriptionInfo specific styles */
.countdown-timer {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  padding: 15px;
  margin-top: 10px;
  border: 2px solid #dee2e6;
  transition: all 0.3s ease;
}

.countdown-timer.countdown-critical {
  background: linear-gradient(135deg, #f8d7da 0%, #f1aeb5 100%);
  border-color: #dc3545;
  animation: pulse-critical 1s infinite;
}

.countdown-timer.countdown-warning {
  background: linear-gradient(135deg, #ffe8d1 0%, #ffd19a 100%);
  border-color: #fd7e14;
  animation: pulse-warning 2s infinite;
}

.countdown-timer.countdown-caution {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border-color: #ffc107;
}

.countdown-main {
  text-align: center;
  margin-top: 10px;
}

.countdown-details {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.time-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 35px;
}

.time-segment strong {
  font-size: 16px;
  font-weight: 700;
  color: #495057;
  line-height: 1;
}

.time-segment small {
  font-size: 10px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.critical-warning {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(220, 53, 69, 0.1);
  border-radius: 4px;
  color: #721c24;
  font-size: 11px;
  font-weight: 600;
}

/* Responsive design */
@media (max-width: 768px) {
  .countdown-breakdown {
    gap: 10px;
  }

  .time-unit {
    min-width: 35px;
  }

  .countdown-value {
    font-size: 20px;
  }

  .time-unit strong {
    font-size: 14px;
  }

  .countdown-details {
    gap: 10px;
  }

  .time-segment {
    min-width: 30px;
  }

  .time-segment strong {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .remaining-time {
    padding: 15px;
  }

  .countdown-breakdown {
    gap: 8px;
  }

  .countdown-value {
    font-size: 18px;
  }

  .time-unit {
    min-width: 30px;
    font-size: 11px;
  }

  .time-unit strong {
    font-size: 13px;
  }

  .countdown-timer {
    padding: 12px;
  }

  .countdown-details {
    gap: 8px;
  }

  .time-segment {
    min-width: 28px;
  }

  .time-segment strong {
    font-size: 13px;
  }

  .time-segment small {
    font-size: 9px;
  }
}
