/* Offline functionality styles */

/* Connection status indicator */
.connection-status {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1000;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.connection-status.online {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.connection-status.offline {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.connection-status::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.connection-status.online::before {
  background: #28a745;
}

.connection-status.offline::before {
  background: #dc3545;
}

/* Offline content wrapper */
.offline-content-wrapper {
  position: relative;
  margin: -1.5rem -2rem;
  padding: 0;
}

.offline-banner {
  background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
  color: #2d3436;
  padding: 1rem 2rem;
  margin-bottom: 0;
  font-weight: 600;
  border-left: 4px solid #e17055;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.offline-banner svg {
  flex-shrink: 0;
}

.offline-breadcrumb {
  background: #f8f9fa;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid #e9ecef;
}

.offline-page-header {
  background: white;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e9ecef;
}

.offline-content {
  background: white;
  padding: 1.5rem 2rem;
  min-height: 60vh;
  position: relative;
}

.offline-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 20px,
    rgba(255, 193, 7, 0.02) 20px,
    rgba(255, 193, 7, 0.02) 40px
  );
  pointer-events: none;
  z-index: 1;
}

.offline-content > * {
  position: relative;
  z-index: 2;
}

.offline-footer {
  background: #f8f9fa;
  padding: 1rem 2rem;
  border-top: 1px solid #e9ecef;
}

.offline-footer button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
}

/* No internet page styles */
.no-internet-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  margin: -1.5rem -2rem;
}

.no-internet-content {
  max-width: 500px;
  width: 100%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.no-internet-content .text-center {
  padding: 3rem 2rem;
}

.no-internet-content h1 {
  font-size: 2rem;
  color: #2d3436;
  font-weight: 700;
}

.no-internet-content p {
  color: #636e72;
  line-height: 1.6;
}

.retry-button {
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.retry-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.retry-button:active {
  transform: translateY(0);
}

/* Body classes for offline/online state */
.app-offline {
  --offline-overlay: rgba(255, 235, 59, 0.03);
}

.app-online {
  --offline-overlay: transparent;
}

/* Offline mode subtle overlay */
.app-offline::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--offline-overlay);
  pointer-events: none;
  z-index: 1;
}

/* Disable forms and buttons when offline */
.app-offline form:not(.offline-safe),
.app-offline button:not(.offline-safe),
.app-offline input[type="submit"]:not(.offline-safe) {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.app-offline form:not(.offline-safe)::after,
.app-offline button:not(.offline-safe)::after {
  content: 'Offline';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  z-index: 10;
}

/* Offline page navigation */
.offline-pages-nav {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  border-left: 4px solid #6c757d;
}

.offline-pages-nav h3 {
  color: #495057;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.offline-pages-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.offline-pages-list li {
  margin-bottom: 0.25rem;
}

.offline-pages-list a {
  color: #6c757d;
  text-decoration: none;
  font-size: 0.9rem;
  display: block;
  padding: 0.25rem 0;
}

.offline-pages-list a:hover {
  color: #495057;
  text-decoration: underline;
}

/* Loading states */
.connection-checking {
  opacity: 0.7;
}

.connection-checking::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 0.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
  .connection-status {
    position: relative;
    top: auto;
    right: auto;
    display: block;
    margin: 1rem 0;
    text-align: center;
  }
  
  .offline-content-wrapper {
    margin: -1rem -1rem;
  }
  
  .offline-banner,
  .offline-breadcrumb,
  .offline-page-header,
  .offline-content,
  .offline-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .offline-banner {
    font-size: 0.9rem;
  }
  
  .no-internet-page {
    min-height: 100vh;
    margin: -1rem -1rem;
    padding: 1rem;
  }
  
  .no-internet-content .text-center {
    padding: 2rem 1.5rem;
  }
  
  .no-internet-content h1 {
    font-size: 1.5rem;
  }
  
  .retry-button {
    width: 100%;
    max-width: 250px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .offline-banner {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #2c3e50;
  }
  
  .offline-breadcrumb,
  .offline-footer {
    background: #2c3e50;
    border-color: #34495e;
  }
  
  .offline-page-header,
  .offline-content {
    background: #34495e;
    color: #ecf0f1;
  }
  
  .no-internet-page {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  }
  
  .no-internet-content {
    background: #34495e;
    color: #ecf0f1;
  }
  
  .no-internet-content h1 {
    color: #ecf0f1;
  }
  
  .no-internet-content p {
    color: #bdc3c7;
  }
  
  .offline-pages-nav {
    background: #34495e;
    border-left-color: #7f8c8d;
  }
  
  .offline-pages-nav h3 {
    color: #ecf0f1;
  }
  
  .offline-pages-list a {
    color: #bdc3c7;
  }
  
  .offline-pages-list a:hover {
    color: #ecf0f1;
  }
  
  .offline-footer {
    color: #bdc3c7;
  }
} 