@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* C3S Palette */
  --c3s-red: rgb(166, 28, 0);       /* #A61C00 */
  --c3s-dark-grey: rgb(67, 67, 67);  /* #434343 */
  --c3s-med-grey: rgb(153, 153, 153); /* #999999 */
  --c3s-light-grey: rgb(204, 204, 204); /* #CCCCCC */

  /* Light Theme (Default) */
  --primary: var(--c3s-red); 
  --primary-hover: #7b1400; 
  --secondary: var(--c3s-dark-grey); 
  
  --bg-gradient-start: #F8FAFC;
  --bg-gradient-end: #F1F5F9;
  --card-bg: #FFFFFF;
  --card-border: rgba(204, 204, 204, 0.5);
  
  --text-main: var(--c3s-dark-grey);
  --text-muted: var(--c3s-med-grey);
  
  --input-bg: rgba(248, 250, 252, 0.8);
  --input-focus: #FFFFFF;

  --error: var(--c3s-red);
}

body.dark-theme {
  /* Premium Dark Theme */
  --bg-gradient-start: #09090b;
  --bg-gradient-end: #18181b;
  --card-bg: rgba(39, 39, 42, 0.6); 
  --card-border: rgba(255, 255, 255, 0.08);
  
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;

  --input-bg: rgba(9, 9, 11, 0.5);
  --input-focus: rgba(39, 39, 42, 1);
  
  /* Brighten primary slightly for better contrast on dark */
  --primary: #dc2626; 
  --primary-hover: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

body {
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Premium Cards */
.glass-container {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.glass-nav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Typography */
h1, h2, h3 {
  font-weight: 700;
  color: var(--text-main);
}

.text-gradient {
  color: var(--primary);
}

/* Inputs & Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(166, 28, 0, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(166, 28, 0, 0.35);
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  background: var(--input-bg);
  border: 1px solid var(--c3s-light-grey);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}

.form-control:focus {
  background: var(--input-focus);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(166, 28, 0, 0.15);
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-main);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    opacity: 0.75;
}

.nav-link:hover {
    background: rgba(150, 21, 21, 0.05);
    color: var(--primary);
    opacity: 1;
}

.nav-link.active {
    background: rgba(150, 21, 21, 0.1);
    color: var(--primary);
    border-left: 4px solid var(--primary);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    opacity: 1;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* Auth Layout */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem;
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 3rem 2.5rem;
  text-align: center;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

/* Dashboard Layout */
.dashboard-wrapper {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  animation: fadeIn 0.8s ease forwards;
}

/* Logo Utility */
.logo-container {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}
.logo-container img {
  max-height: 80px;
  object-fit: contain;
}
.nav-logo {
  max-height: 35px;
  margin-right: 0.75rem;
}

/* Theme Toggle */
.theme-toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
}
@media (min-width: 768px) {
    .theme-toggle-container.nav-toggle {
        position: static;
    }
}

/* Animations */
@keyframes slideUp {
  0% { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Pagination Fix */
.pagination {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    justify-content: center;
}
.page-item .page-link {
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-main);
    text-decoration: none;
    transition: 0.2s;
}
.page-item.active .page-link, .page-item.active span {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.page-item.disabled .page-link, .page-item.disabled span {
    opacity: 0.5;
    cursor: not-allowed;
}
.page-item:not(.active):not(.disabled) .page-link:hover {
    background: var(--background);
    color: var(--primary);
}
