/* Shared Styles for DataNova Labs */

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --error: #ef4444;
  --card-radius: 16px;
  
  /* Aliases for shared components to keep them decoupled if needed */
  --shared-nav-bg: var(--glass-bg);
  --shared-glass-border: var(--glass-border);
  --shared-text-muted: var(--text-muted);
  --shared-primary: var(--primary);
  --shared-accent-gradient: linear-gradient(to right, #818cf8, #c084fc);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

.layout-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  width: 100%;
  position: relative;
}

.container-wide {
  max-width: 1400px;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding: 12px 24px;
  background: var(--shared-nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--shared-glass-border);
  border-radius: 12px;
  width: 100%;
}

/* For pages where navbar should be fixed at top */
.navbar-fixed {
  position: fixed !important;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90% !important;
  max-width: 1200px;
  z-index: 1000;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.2rem;
  background: var(--shared-accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: var(--shared-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link:hover {
  color: var(--shared-primary);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.shared-footer {
  margin-top: 60px;
  padding: 24px 0;
  border-top: 1px solid var(--shared-glass-border);
  text-align: center;
  color: var(--shared-text-muted);
  font-size: 0.875rem;
  width: 100%;
}

/* Page Header Styles */
.page-header {
  text-align: center;
  margin-bottom: 24px;
  animation: sharedFadeInDown 0.8s ease-out;
}

@keyframes sharedFadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--shared-accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0px;
  letter-spacing: -0.02em;
}

.page-header p {
  color: var(--shared-text-muted);
  font-size: 0.8rem;
}

/* Responsive headers */
@media (max-width: 768px) {
  .page-header h1 {
    font-size: 1.5rem;
  }
}

/* Auth Section Styles */
.auth-section {
  max-width: 600px;
  margin: 0 auto 40px;
  animation: sharedFadeInUp 0.8s ease-out;
}

@keyframes sharedFadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.role-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.role-opt {
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.role-opt.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="password"],
input[type="date"],
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-main);
  font-family: inherit;
  transition: all 0.3s;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper input {
  padding-right: 45px !important;
}

.password-toggle {
  position: absolute;
  right: 14px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.password-toggle:hover {
  color: var(--primary);
  transform: scale(1.1);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  gap: 10px;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-hover) 100%
  );
  color: white;
  width: 100%;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.loader {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Tabs System */
.tabs-container {
  margin-top: 24px;
  width: 100%;
}

.tabs-header {
  display: flex;
  gap: 8px;
  margin-bottom: 30px;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px;
  border-radius: 14px;
  width: fit-content;
}

.tabs-centered {
  margin-left: auto;
  margin-right: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 24px;
  cursor: pointer;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s;
  font-family: inherit;
}

.tab-btn:hover:not(.active) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-content {
  display: none;
  animation: sharedTabFadeIn 0.5s ease;
}

@keyframes sharedTabFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
  display: block;
}

/* Locking System */
.locked {
  position: relative !important;
  pointer-events: none !important;
  user-select: none !important;
}

.locked > *:not(.lock-overlay) {
  filter: blur(10px);
  opacity: 0.4;
  transition: all 0.4s ease;
}

.lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(2px);
  border-radius: inherit;
  color: var(--text-main);
  text-align: center;
  padding: 30px;
  animation: sharedFadeIn 0.5s ease;
}

.locked .lock-overlay {
  display: flex;
}

.lock-icon {
  margin-bottom: 16px;
  color: var(--primary);
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.3));
}

.lock-text {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-main);
}

/* Ensure container has enough padding when navbar is fixed */
body.has-fixed-nav {
  padding-top: 100px !important;
}
