/**
 * =====================================================
 * SPORT DARTTIME PWA - STILI COMPLETI
 * Include stili per notifiche, toast e installazione PWA
 * =====================================================
 */

/* ========================================
   🎨 VARIABILI CSS PER SPORT DARTTIME
   ======================================== */
:root {
  --tg-primary: #d4af37;
  --tg-primary-dark: #c19525;
  --tg-background: #000000;
  --tg-surface: #1a1a1a;
  --tg-text: #ffffff;
  --tg-text-muted: #cccccc;
  --tg-border: #333333;
  --tg-success: #27ae60;
  --tg-warning: #f39c12;
  --tg-error: #e74c3c;
  --tg-info: #3498db;
  --tg-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  --tg-border-radius: 8px;
  --tg-transition: all 0.3s ease;
}

/* ========================================
   📱 STILI TOAST NOTIFICHE
   ======================================== */
.pwa-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--tg-surface);
  color: var(--tg-text);
  padding: 12px 20px;
  border-radius: var(--tg-border-radius);
  box-shadow: var(--tg-shadow);
  border-left: 4px solid var(--tg-primary);
  z-index: 10000;
  min-width: 300px;
  max-width: 400px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  transform: translateX(420px);
  opacity: 0;
  transition: var(--tg-transition);
  word-wrap: break-word;
}

.pwa-toast.pwa-toast-show {
  transform: translateX(0);
  opacity: 1;
}

/* Varianti colore toast */
.pwa-toast-success {
  border-left-color: var(--tg-success);
  background: rgba(39, 174, 96, 0.70);
}

.pwa-toast-warning {
  border-left-color: var(--tg-warning);
  background: rgba(243, 156, 18, 0.70);
}

.pwa-toast-error {
  border-left-color: var(--tg-error);
  background: rgba(231, 76, 60, 0.70);
}

.pwa-toast-info {
  border-left-color: var(--tg-info);
  background: rgba(52, 152, 219, 0.70);
}

/* Toast responsive */
@media (max-width: 480px) {
  .pwa-toast {
    right: 10px;
    left: 10px;
    min-width: auto;
    max-width: none;
    transform: translateY(-100px);
  }
  
  .pwa-toast.pwa-toast-show {
    transform: translateY(0);
  }
}

/* ========================================
   🔔 STILI PULSANTI NOTIFICHE
   ======================================== */
.tg-notification-btn {
  background: linear-gradient(45deg, var(--tg-primary), var(--tg-primary-dark));
  color: var(--tg-background);
  border: none;
  padding: 12px 24px;
  border-radius: var(--tg-border-radius);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--tg-transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--tg-shadow);
  text-decoration: none;
  font-family: inherit;
}

.tg-notification-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.tg-notification-btn:active {
  transform: translateY(0);
}

.tg-notification-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.tg-notification-btn--secondary {
  background: var(--tg-surface);
  color: var(--tg-text);
  border: 1px solid var(--tg-border);
}

.tg-notification-btn--secondary:hover {
  background: var(--tg-border);
  box-shadow: var(--tg-shadow);
}

/* ========================================
   📲 STILI INSTALLAZIONE PWA
   ======================================== */
#pwa-install-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 9999;
  display: none;
}

#pwa-install-container.sticky {
    top: 0;
}

#pwa-install-btn {
  background: linear-gradient(45deg, var(--tg-primary), var(--tg-primary-dark));
  color: var(--tg-background);
  border: none;
  padding: 16px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: var(--tg-transition);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--tg-shadow);
  white-space: nowrap;
  font-family: inherit;
}

#pwa-install-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
}

#pwa-install-btn:active {
  transform: translateY(-1px) scale(1.02);
}

#pwa-install-btn::before {
  content: '📱';
  font-size: 20px;
}

/* Installazione PWA responsive */
@media (max-width: 480px) {
  #pwa-install-container {
    top: 70px;
    right: 10px;
    left: 10px;
  }
  
  #pwa-install-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 15px;
  }
}

/* ========================================
   🎛️ PANNELLO CONTROLLO NOTIFICHE
   ======================================== */
.tg-notification-panel {
  background: var(--tg-surface);
  border: 1px solid var(--tg-border);
  border-radius: var(--tg-border-radius);
  padding: 20px;
  margin: 20px 0;
  color: var(--tg-text);
}

.tg-notification-panel h3 {
  margin: 0 0 15px 0;
  color: var(--tg-primary);
  font-size: 18px;
}

.tg-notification-panel p {
  margin: 0 0 15px 0;
  color: var(--tg-text-muted);
  line-height: 1.5;
}

.tg-notification-panel .button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tg-notification-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--tg-background);
  border-radius: 20px;
  font-size: 14px;
  margin-bottom: 15px;
}

.tg-notification-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tg-error);
}

.tg-notification-status.enabled::before {
  background: var(--tg-success);
}

.tg-notification-status.supported::before {
  background: var(--tg-warning);
}

/* ========================================
   ⚡ ANIMAZIONI E LOADING
   ======================================== */
.tg-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--tg-border);
  border-top: 2px solid var(--tg-primary);
  border-radius: 50%;
  animation: tg-spin 1s linear infinite;
}

@keyframes tg-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.tg-pulse {
  animation: tg-pulse 2s ease-in-out infinite;
}

@keyframes tg-pulse {
  0%, 100% { 
    transform: scale(1); 
    opacity: 1; 
  }
  50% { 
    transform: scale(1.05); 
    opacity: 0.8; 
  }
}

/* ========================================
   🔧 UTILITY CLASSES
   ======================================== */
.tg-hidden {
  display: none !important;
}

.tg-invisible {
  visibility: hidden;
  opacity: 0;
}

.tg-visible {
  visibility: visible;
  opacity: 1;
  transition: var(--tg-transition);
}

.tg-text-center {
  text-align: center;
}

.tg-text-muted {
  color: var(--tg-text-muted);
}

.tg-mb-1 { margin-bottom: 10px; }
.tg-mb-2 { margin-bottom: 20px; }
.tg-mb-3 { margin-bottom: 30px; }

.tg-mt-1 { margin-top: 10px; }
.tg-mt-2 { margin-top: 20px; }
.tg-mt-3 { margin-top: 30px; }

/* ========================================
   📱 MEDIA QUERIES RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .tg-notification-panel {
    margin: 15px 0;
    padding: 15px;
  }
  
  .tg-notification-panel .button-group {
    flex-direction: column;
  }
  
  .tg-notification-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .tg-notification-panel {
    margin: 10px;
    padding: 12px;
    border-radius: 6px;
  }
  
  .tg-notification-panel h3 {
    font-size: 16px;
  }
  
  .tg-notification-btn {
    padding: 10px 20px;
    font-size: 13px;
  }
}

/* ========================================
   🌗 SUPPORTO DARK MODE
   ======================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --tg-background: #000000;
    --tg-surface: #1a1a1a;
    --tg-text: #ffffff;
    --tg-text-muted: #cccccc;
    --tg-border: #333333;
  }
}

/* ========================================
   ♿ ACCESSIBILITÀ
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.tg-notification-btn:focus-visible,
#pwa-install-btn:focus-visible {
  outline: 3px solid var(--tg-primary);
  outline-offset: 2px;
}

/* ========================================
   🎯 STILI SPECIFICI SPORT DARTTIME
   ======================================== */
.darttime-notification-icon::before {
  content: '🎯';
  margin-right: 8px;
}

.darttime-install-prompt {
  background: linear-gradient(135deg, var(--tg-background), var(--tg-surface));
  border: 2px solid var(--tg-primary);
  border-radius: var(--tg-border-radius);
  padding: 20px;
  text-align: center;
  margin: 20px 0;
}

.darttime-install-prompt h4 {
  color: var(--tg-primary);
  margin-bottom: 10px;
}

.darttime-install-prompt p {
  color: var(--tg-text-muted);
  margin-bottom: 15px;
  line-height: 1.5;
}

/* ========================================
   📊 INDICATORI STATO
   ======================================== */
.tg-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--tg-surface);
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tg-status-indicator--online {
  color: var(--tg-success);
  border: 1px solid var(--tg-success);
}

.tg-status-indicator--offline {
  color: var(--tg-error);
  border: 1px solid var(--tg-error);
}

.tg-status-indicator--pending {
  color: var(--tg-warning);
  border: 1px solid var(--tg-warning);
}






/* ========================================
   🎨 STILI BANNER iOS DARTTIME
   ======================================== */

.ios-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ios-banner.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.ios-banner.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.ios-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.ios-banner-content {
    position: relative;
    width: 100%;
	z-index:999999;
    max-width: 500px;
    margin: 0 auto 0;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    padding: 24px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ios-banner.show .ios-banner-content {
    transform: translateY(0);
}

/* Header Banner */
.ios-banner-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.ios-banner-icon {
    position: relative;
    margin-right: 16px;
}

.app-icon {
    width: 40px;
    height: 40px;
    /*border-radius: 13px;*/
    /*box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);*/
}

.icon-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 50%);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.ios-banner-info {
    flex: 1;
}

.ios-banner-info h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
}

.ios-banner-subtitle {
    margin: 0;
    font-size: 14px;
    color: #86868b;
}

.ios-banner-close {
    background: none;
    border: none;
    padding: 8px;
    color: #86868b;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.ios-banner-close:hover {
    background: #f5f5f7;
    color: #1d1d1f;
}

/* Passi Installazione */
.ios-install-steps {
    margin-bottom: 24px;
}

.step-intro {
    margin-bottom: 16px;
    text-align: center;
}

.step-intro p {
    margin: 0;
    color: #86868b;
    font-size: 14px;
}

.install-step {
    display: flex;
    align-items: center;
    padding: 12px 0;
    position: relative;
}

.step-number {
    width: 32px;
    height: 32px;
    background: #007AFF;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 16px;
    flex-shrink: 0;
}

.step-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.step-text strong {
    color: #1d1d1f;
    font-size: 15px;
    margin-bottom: 2px;
}

.step-text span {
    color: #86868b;
    font-size: 13px;
}

.step-arrow {
    margin-left: 12px;
    color: #86868b;
    opacity: 0.5;
}

/* Animazioni Icone */
.bounce {
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
}

.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.rotate {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Benefici */
.ios-benefits {
    margin-bottom: 24px;
    padding: 16px;
    background: #f5f5f7;
    border-radius: 12px;
}

.ios-benefits h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #1d1d1f;
    text-align: center;
}

.benefits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.benefit-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #1d1d1f;
}

.benefit-icon {
    margin-right: 8px;
    font-size: 16px;
}

/* Pulsanti Azione */
.ios-banner-actions {
    display: flex;
    gap: 12px;
}

.ios-btn-primary {
    flex: 1;
    background: #007AFF;
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ios-btn-primary:hover {
    background: #0056CC;
    transform: translateY(-1px);
}

.ios-btn-secondary {
    flex: 1;
    background: #f5f5f7;
    color: #007AFF;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ios-btn-secondary:hover {
    background: #e5e5e7;
}

/* Responsive Design */
@media (max-width: 480px) {
    .ios-banner-content {
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .ios-banner-actions {
        flex-direction: column;
    }
}

/* Accessibilità */
@media (prefers-reduced-motion: reduce) {
    .bounce, .pulse, .rotate, .icon-shine {
        animation: none;
    }
    
    .ios-banner, .ios-banner-content {
        transition: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .ios-banner-content {
        background: #1c1c1e;
    }
    
    .ios-banner-info h3 {
        color: #ffffff;
    }
    
    .ios-benefits {
        background: #2c2c2e;
    }
    
    .ios-benefits h4 {
        color: #ffffff;
    }
    
    .benefit-item {
        color: #ffffff;
    }
    
    .step-text strong {
        color: #ffffff;
    }
    
    .ios-btn-secondary {
        background: #2c2c2e;
        color: #007AFF;
    }
}