/* LiteBase - Custom Styles */

:root {
  --lb-primary: #6366f1;
  --lb-primary-dark: #4f46e5;
  --lb-secondary: #64748b;
  --lb-success: #22c55e;
  --lb-warning: #f59e0b;
  --lb-danger: #ef4444;
  --lb-info: #06b6d4;
  --lb-dark: #0f172a;
  --lb-darker: #020617;
  --lb-card-bg: #1e293b;
  --lb-border: #334155;
}

/* General Styles */
body {
  background: linear-gradient(135deg, var(--lb-darker) 0%, var(--lb-dark) 100%);
  min-height: 100vh;
}

/* Auth Pages */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: var(--lb-card-bg);
  border: 1px solid var(--lb-border);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Main Content */
.main-content {
  padding-top: 56px;
}

/* Cards */
.card {
  background: var(--lb-card-bg);
  border: 1px solid var(--lb-border);
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-header {
  border-bottom: 1px solid var(--lb-border);
}

.database-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(99, 102, 241, 0.2);
}

/* Stat Cards */
.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card.border-primary::before { background: var(--lb-primary); }
.stat-card.border-success::before { background: var(--lb-success); }
.stat-card.border-info::before { background: var(--lb-info); }
.stat-card.border-warning::before { background: var(--lb-warning); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* SQL Editor */
.sql-editor {
  background: var(--lb-darker);
  border: none;
  border-radius: 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  padding: 1rem;
  color: #e2e8f0;
}

.sql-editor:focus {
  background: var(--lb-darker);
  box-shadow: none;
  color: #e2e8f0;
}

.sql-editor::placeholder {
  color: #64748b;
}

/* Results Container */
.results-container {
  max-height: 400px;
  overflow: auto;
}

.results-container table {
  margin-bottom: 0;
}

.results-container th {
  position: sticky;
  top: 0;
  background: var(--lb-card-bg);
  z-index: 10;
}

/* Schema Explorer */
.schema-explorer .accordion-button {
  background: transparent;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.schema-explorer .accordion-button:not(.collapsed) {
  background: rgba(99, 102, 241, 0.1);
  color: var(--lb-primary);
}

.schema-explorer .accordion-button:focus {
  box-shadow: none;
}

.schema-explorer .accordion-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--lb-border);
}

/* Progress Bars */
.progress {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
}

/* Navbar */
.navbar {
  backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.9) !important;
}

.navbar-brand {
  font-size: 1.25rem;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--lb-primary) 0%, var(--lb-primary-dark) 100%);
  border: none;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--lb-primary-dark) 0%, var(--lb-primary) 100%);
  transform: translateY(-1px);
}

/* Code Blocks */
pre {
  background: var(--lb-darker);
  border: 1px solid var(--lb-border);
}

code {
  color: #f472b6;
}

/* Form Controls */
.form-control, .form-select {
  background: var(--lb-darker);
  border: 1px solid var(--lb-border);
  color: #e2e8f0;
}

.form-control:focus, .form-select:focus {
  background: var(--lb-darker);
  border-color: var(--lb-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  color: #e2e8f0;
}

.input-group-text {
  background: var(--lb-card-bg);
  border-color: var(--lb-border);
  color: #94a3b8;
}

/* Tables */
.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(99, 102, 241, 0.1);
}

.table > thead {
  border-bottom: 2px solid var(--lb-border);
}

.table > tbody > tr {
  border-bottom: 1px solid var(--lb-border);
}

/* Badges */
.badge {
  font-weight: 500;
  padding: 0.4em 0.8em;
}

/* Dropdown */
.dropdown-menu {
  background: var(--lb-card-bg);
  border: 1px solid var(--lb-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dropdown-item {
  color: #e2e8f0;
}

.dropdown-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--lb-primary);
}

.dropdown-divider {
  border-color: var(--lb-border);
}

/* Modal */
.modal-content {
  background: var(--lb-card-bg);
  border: 1px solid var(--lb-border);
}

.modal-header, .modal-footer {
  border-color: var(--lb-border);
}

/* Accordion */
.accordion-body {
  background: transparent;
}

/* Toast */
.toast {
  border-radius: 0.5rem;
}

/* Breadcrumb */
.breadcrumb {
  background: transparent;
  margin-bottom: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: #64748b;
}

.breadcrumb-item a {
  color: var(--lb-primary);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--lb-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--lb-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
  .auth-card {
    padding: 1.5rem;
  }
  
  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
}
