/* Basic Reset */
:root {
  --primary: #4361ee;
  --primary-light: #6c8aff;
  --background: #f5f7fa;
  --card-bg: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --border: #e1e4e8;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --transition: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.5;
  padding: 10px;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px;
  width: 100%;
}

/* Header */
header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
  color: var(--primary);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 0 10px;
  line-height: 1.4;
}

header h1 a {
  color: #0697da;
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
}

header h1 a:hover {
  color: var(--primary);
  text-decoration: underline;
}

@media (min-width: 768px) {
  header h1 {
    font-size: 2.2rem;
    justify-content: flex-start;
    text-align: left;
    white-space: nowrap;
  }
}

h1 i {
  color: var(--primary-light);
}

.search-container {
  margin-bottom: 20px;
  position: relative;
  width: 100%;
}

.search-wrapper {
  position: relative;
  display: flex;
  width: 100%;
  gap: 10px;
}

#searchInput {
  flex: 1;
  width: 100%;
  padding: 12px 15px 12px 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 16px;
  transition: var(--transition);
  height: 48px;
}

#searchInput:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Desktop refresh button */
#refreshBtn {
  display: none; /* Hidden by default on mobile */
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
  white-space: nowrap;
}

/* Mobile refresh button */
#mobileRefreshBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

#mobileRefreshBtn i {
  font-size: 18px;
}

/* Show/hide buttons based on screen size */
@media (max-width: 767px) {
  .mobile-refresh {
    display: flex !important;
  }
  .desktop-refresh {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .mobile-refresh {
    display: none !important;
  }
  .desktop-refresh {
    display: flex !important;
  }
}

#refreshBtn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Dashboard Grid */
#dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-top: 20px;
  width: 100%;
}

@media (min-width: 480px) {
  #dashboard {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (min-width: 768px) {
  #dashboard {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
  }
}

/* Website Card */
.website-card {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.website-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--border);
}

.favicon-container {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.card-favicon {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 14px;
  line-height: 1;
  overflow: hidden;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-url {
  padding: 15px 20px;
  color: var(--text-light);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #f9f9f9;
}

.card-footer {
  padding: 12px 20px;
  background: #f9fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.card-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #666;
}

.card-status.online {
  color: #28a745; /* Green for online status */
}

.card-status.offline {
  color: #dc3545; /* Red for offline status */
}

.card-status i {
  font-size: 0.6rem;
  margin-right: 2px;
  font-size: 8px;
}

/* Search icon */
.search-wrapper::before {
  content: '\f002';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
  z-index: 1;
}

/* Toast notifications */
#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  max-width: 90%;
  text-align: center;
}

#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

#toast.success {
  background: #4caf50;
}

#toast.error {
  background: #f44336;
}

/* Loading spinner animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Button loading state */
#refreshBtn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

#refreshBtn .fa-spin {
  animation: spin 1s linear infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #dashboard {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .search-container {
    flex-direction: column;
  }
  
  #searchInput {
    width: 100%;
    margin-bottom: 10px;
  }
  
  #refreshBtn {
    width: 100%;
    justify-content: center;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.btn:hover {
  background: var(--secondary);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn i {
  font-size: 1rem;
}
  
/* Dashboard container */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
  padding: 1rem 0;
  position: relative;
  min-height: 60vh;
}

/* Loading Spinner */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--border);
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.loading-spinner p {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-top: 1rem;
}
  
/* Card styling */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  height: 120px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(67, 97, 238, 0.05);
}

.card-favicon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.card-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-url {
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-footer {
  margin-top: auto;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 50px;
  background: var(--success);
  color: white;
}

.card-status.offline {
  background: var(--error);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--card-bg);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--error);
}

.toast i {
  font-size: 1.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .controls {
    width: 100%;
  }
  
  .search-box {
    flex: 1;
    min-width: auto;
  }
  
  .dashboard {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  
  .btn .btn-text {
    display: none;
  }
  
  .btn {
    padding: 0.6rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    justify-content: center;
  }
  
  .btn i {
    margin: 0;
  }
}
  
  /* Border animation for hover */
  .card .border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(360deg, rgb(163, 244, 255), rgb(2, 247, 255));
  }
  
  /* Card content styling */
  .card h3 {
    position: absolute;
    bottom: 20px;
    left: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 2;
    color: #000000;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 20px);
  }
  
  /* Favicon styling */
  .favicon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
  }
  
  /* Card hover effect */
  .card:hover {
    transform: scale(1.1);
    transition: 0.7s;
  }
  
  /* Border hover effect */
.card:hover .border {
    background: linear-gradient(180deg, rgb(163, 244, 255), rgb(2, 247, 255));  /* Slightly darker shade of blue */
}
  
  /* Card preview (thumbnail on hover) */
  .card .preview {
    display: none;
    position: absolute;
    top: 10px;
    left: 10px;
    width: 230px;
    height: 150px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    overflow: hidden;
    z-index: 3;
  }
  
  /* Show preview on hover */
  .card:hover .preview {
    display: block;
  }
  
  /* Glowing effect for the page */
  @keyframes glow {
    0% {
      text-shadow: 0 0 10px #00796b, 0 0 20px #00796b;
    }
    100% {
      text-shadow: 0 0 15px #004d40, 0 0 25px #004d40;
    }
  }
  
  /* Error message styling */
  .error {
    font-size: 1.2rem;
    color: #e74c3c;
    text-align: center;
    margin-top: 2rem;
    animation: errorAnim 1.5s infinite alternate;
  }
  
  @keyframes errorAnim {
    0% {
      color: #e74c3c;
      transform: scale(1);
    }
    100% {
      color: #ffb74d;
      transform: scale(1.1);
    }
  }
  
