/* X Link - Unique Modern Minimalist Design */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Unique modern color palette - X brand black primary */
  --font-family: "Cairo", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-arabic: "Cairo", "Noto Sans Arabic", sans-serif;
  --primary: #000000;
  --primary-hover: #1a1a1a;
  --primary-light: #333333;
  --accent: #6366f1;
  --success: #10b981;
  --error: #f43f5e;
  --warning: #f59e0b;
  --background-color: #ffffff;
  --surface: #f8fafc;
  --card-background: #ffffff;
  --text-color: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --spacing: 1rem;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --grid-gutter: 1.5rem;
}

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

html {
  font-size: 16px;
  color-scheme: light only;
}

/* Force light theme - prevent dark mode */
@media (prefers-color-scheme: dark) {
  html {
    color-scheme: light;
  }
}

body {
  font-family: var(--font-family);
  background-color: var(--surface);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Arabic text support */
[dir="rtl"],
[lang="ar"] {
  font-family: var(--font-arabic);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  letter-spacing: -0.025em;
}

h1 { font-size: 2.25rem; font-weight: 800; }
h2 { font-size: 1.75rem; font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 700; }
h4 { font-size: 1.25rem; font-weight: 600; }
h5 { font-size: 1.125rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

p {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

a:hover {
  color: var(--primary-hover);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem var(--grid-gutter);
  width: 100%;
}

/* Grid System */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: calc(var(--grid-gutter) * -0.5);
  margin-right: calc(var(--grid-gutter) * -0.5);
}

[class*="col-"] {
  padding-left: calc(var(--grid-gutter) * 0.5);
  padding-right: calc(var(--grid-gutter) * 0.5);
  flex: 0 0 100%;
  max-width: 100%;
}

.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Responsive Columns */
@media (min-width: 768px) {
  .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-md-9 { flex: 0 0 75%; max-width: 75%; }
  .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 1024px) {
  .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
  .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
  .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Buttons - Modern minimalist */
button,
a[role="button"],
input[type="submit"],
input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
  width: 100%;
  min-height: 44px;
  box-shadow: var(--shadow-sm);
}

button:hover,
a[role="button"]:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow);
}

button:active,
a[role="button"]:active,
input[type="submit"]:active,
input[type="button"]:active {
  box-shadow: var(--shadow-sm);
  opacity: 0.95;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Forms - Clean modern inputs */
form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  padding: 0.75rem 1rem;
  background-color: var(--background-color);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-color);
  font-size: 0.9375rem;
  font-family: inherit;
  font-weight: 400;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  width: 100%;
  min-height: 44px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
  background-color: var(--background-color);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* Cards - Modern minimalist */
.card {
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 1;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-color);
}

.card-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.card-header h3,
.card-header h4,
.card-header header {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: -0.02em;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

/* Dashboard Styles */
.dashboard {
  margin: 0 auto;
  margin-top: 1rem;
  width: 100%;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.dashboard-header h4 {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.dashboard-header h3 {
  color: var(--text-color);
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 1.5rem;
}

.dashboard-header h1 {
  color: var(--primary);
  font-size: 2.5rem;
  margin: 0;
  font-weight: 800;
}

/* Stat Cards */
.stat-card {
  text-align: center;
}

.stat-card .card-header {
  border: none;
  padding: 0;
  margin-bottom: 1.25rem;
}

.stat-card .card-header header {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}

.sent-requests {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin: 0;
  letter-spacing: -0.03em;
}

/* API Status Card */
.api-status-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.api-status-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-color);
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.status-indicator.status-up {
  background-color: var(--success);
}

.status-indicator.status-down {
  background-color: var(--error);
}

.status-indicator.status-checking {
  background-color: var(--warning);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.status-url {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  background-color: var(--surface);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  font-weight: 500;
}

.url-icon {
  font-size: 0.875rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem;
  margin-top: 1rem;
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.125rem;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.metric-item:hover {
  background-color: var(--background-color);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 1.375rem;
  color: var(--primary);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.uptime-value {
  color: var(--success);
}

/* Auth Form */
.auth-form {
  position: sticky;
  top: 2rem;
}

.auth-form .card-header h3 {
  font-size: 1.125rem;
  color: var(--text-color);
  font-weight: 700;
}

/* Home Page Styles */
.hero-section {
  text-align: center;
  padding: 4rem 0;
  margin-bottom: 4rem;
}

.hero-section h1 {
  margin-bottom: 1rem;
  color: var(--primary);
  font-weight: 800;
}

.hero-section h2 {
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 1.5rem;
}

.hero-section p {
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.feature {
  height: 100%;
  transition: box-shadow 0.3s ease;
}

.feature:hover {
  box-shadow: var(--shadow-md);
}

.feature h3 {
  color: var(--text-color);
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.feature p {
  font-size: 0.9375rem;
  margin: 0;
  color: var(--text-secondary);
}

.cta {
  margin-top: 2rem;
}

.cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: white;
  padding: 0.875rem 2rem;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  width: auto;
  min-height: 44px;
  min-width: 140px;
  box-shadow: var(--shadow);
}

.cta a:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.cta a:active {
  box-shadow: var(--shadow);
  opacity: 0.95;
}

/* Navigation Bar */
.navbar {
  background-color: var(--card-background);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--grid-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-color);
  transition: color 0.2s ease;
  font-weight: 700;
  font-size: 1.25rem;
}

.nav-logo:hover {
  color: var(--primary);
}

.nav-icon {
  width: 32px;
  height: 32px;
  display: block;
  transition: opacity 0.2s ease;
}

.nav-logo:hover .nav-icon {
  opacity: 0.85;
}

.nav-brand {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
}

/* Responsive */
@media (max-width: 767px) {
  .container {
    padding: 1rem var(--grid-gutter);
  }
  
  .navbar {
    margin-bottom: 1rem;
  }
  
  .nav-icon {
    width: 28px;
    height: 28px;
  }
  
  .nav-brand {
    font-size: 1.125rem;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .auth-form {
    position: static;
  }
  
  .dashboard-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }
  
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .api-status-card .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .sent-requests {
    font-size: 2.5rem;
  }
}
