/* =========================================
   CASE BRIDGE MAHOGANY THEME - REFINED DESIGN
   ========================================= */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Cinzel+Decorative:wght@400;700&family=Cormorant+Garamond:wght@300;400;600&display=swap');

/* --- Color Palette --- */
:root {
  --mahogany-dark: #2a1512;
  --mahogany-darker: #1a0d0a;
  --mahogany-accent: #4a2318;
  --mahogany-accent-hover: #5f2e20;

  --gold-text: #d4a574;
  --gold-light: #e8c9a0;
  --gold-bright: #f5ddb5;

  --panel-bg: rgba(0, 0, 0, 0.25);
  --panel-border: rgba(212, 165, 116, 0.2);

  --table-header-bg: rgba(0, 0, 0, 0.4);
  --table-row-border: rgba(212, 165, 116, 0.15);
}

/* --- Global Background --- */
body {
  margin: 0;
  padding: 0;
  background: var(--mahogany-darker);
  background-image: url('/images/mahogany.png');
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: center;
  color: var(--gold-light);
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Vignette Overlay --- */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    rgba(0,0,0,0.2) 0%,
    rgba(0,0,0,0.6) 100%
  );
  z-index: 0;
}

/* --- Header Section --- */
header {
  position: relative;
  border-bottom: 2px solid rgba(212, 165, 116, 0.3);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: 0;
}

/* --- Page Title (Case Bridge Dashboard) --- */
.page-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 3rem;
  font-weight: 400;
  text-align: center;
  color: var(--gold-bright);
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.05em;
  margin: 30px 0 20px 0;
  padding: 0;
}

/* --- User Info (Logged in as...) --- */
.user-info {
  position: absolute;
  top: 20px;
  right: 40px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  color: var(--gold-text);
  text-align: right;
}

/* --- Navigation Bar --- */
.navbar,
header nav {
  background: transparent !important;
  border: none !important;
  padding: 15px 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.navbar .container {
  max-width: 1400px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.navbar-brand {
  display: none !important;
}

.navbar-nav {
  display: flex;
  gap: 40px;
  margin: 0 auto;
  padding: 0;
}

.navbar-nav .nav-item {
  list-style: none;
}

.navbar-nav .nav-link {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold-text) !important;
  text-decoration: none;
  padding: 8px 16px !important;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--gold-bright) !important;
  border-bottom: 2px solid var(--gold-text);
  transform: translateY(-2px);
}

.navbar-nav .nav-link i {
  display: none;
}

/* --- Action Button Row --- */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.action-button,
.btn-action {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.6);
  color: var(--gold-light);
  border: 2px solid rgba(212, 165, 116, 0.4);
  border-radius: 8px;
  padding: 12px 28px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.action-button:hover,
.btn-action:hover {
  background: rgba(212, 165, 116, 0.15);
  color: var(--gold-bright);
  border-color: var(--gold-text);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 165, 116, 0.3);
}

/* --- Content Container --- */
.container,
main {
  position: relative;
  background: transparent !important;
  padding: 20px;
  flex: 1;
}

/* --- Section Headings --- */
h1, h2 {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--gold-light);
  margin: 40px 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(212, 165, 116, 0.3);
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

h3, h4, h5, h6 {
  font-family: 'Cinzel', serif;
  color: var(--gold-text);
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
}

table thead th {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--table-header-bg);
  color: var(--gold-light);
  padding: 14px 16px;
  text-align: left;
  border-bottom: 2px solid var(--panel-border);
}

table tbody td {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  padding: 12px 16px;
  color: var(--gold-light);
  border-bottom: 1px solid var(--table-row-border);
}

table tbody tr {
  background: rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease;
}

table tbody tr:hover {
  background: rgba(212, 165, 116, 0.08);
}

/* --- Empty State Messages --- */
.no-data,
.text-center.text-muted {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  color: var(--gold-text) !important;
  text-align: center;
  padding: 40px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  margin: 20px 0;
}

/* --- Pagination --- */
.pagination-info {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  color: var(--gold-text);
  text-align: right;
  margin: 20px 0;
}

/* --- Buttons --- */
button,
.btn {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.6);
  color: var(--gold-light) !important;
  border: 1px solid rgba(212, 165, 116, 0.4);
  padding: 10px 20px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

button:hover,
.btn:hover {
  background: rgba(212, 165, 116, 0.15) !important;
  color: var(--gold-bright) !important;
  border-color: var(--gold-text);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--mahogany-accent) !important;
  border-color: var(--gold-text) !important;
}

.btn-primary:hover {
  background: var(--mahogany-accent-hover) !important;
}

/* --- Form Controls --- */
.form-control,
.form-select,
input,
select,
textarea {
  background: rgba(255, 248, 220, 0.95); /* Elegant beige/cream background */
  border: 1px solid rgba(139, 90, 43, 0.4); /* Darker brown border */
  color: #2a1512; /* Dark brown text for readability */
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  padding: 10px 14px;
  border-radius: 6px;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
  background: rgba(255, 252, 240, 1); /* Brighter cream on focus */
  border-color: rgba(139, 90, 43, 0.6);
  color: #1a0d0a; /* Even darker text on focus */
  box-shadow: 0 0 0 0.25rem rgba(212, 165, 116, 0.25);
  outline: none;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: rgba(42, 21, 18, 0.4); /* Subtle placeholder */
  opacity: 1;
}

.form-label,
label {
  font-family: 'Cinzel', serif;
  color: var(--gold-text);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
}

/* --- Links --- */
a {
  color: var(--gold-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

/* --- Cards and Panels --- */
.card,
.dashboard-panel {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
  backdrop-filter: blur(4px);
}

.card-header {
  background: var(--table-header-bg);
  color: var(--gold-text);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 1.2rem;
  border-bottom: 1px solid var(--panel-border);
  padding: 14px 18px;
}

.card-body {
  background: transparent;
  color: var(--gold-light);
}

/* --- Alerts --- */
.alert {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--panel-border);
  color: var(--gold-light);
  border-radius: 6px;
  padding: 15px 20px;
}

/* --- Modals --- */
.modal-content {
  background: var(--mahogany-darker);
  border: 2px solid var(--panel-border);
  color: var(--gold-light);
  border-radius: 10px;
}

.modal-header {
  background: var(--mahogany-accent);
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  border-bottom: 1px solid var(--panel-border);
}

.modal-body {
  background: var(--mahogany-darker);
  color: var(--gold-light);
}

.modal-footer {
  border-top: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.3);
}

.modal-title {
  color: var(--gold-bright);
}

.btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.btn-close:hover {
  opacity: 1;
}

/* --- Modal Form Controls (Better Contrast) --- */
.modal .form-control,
.modal .form-select,
.modal input[type="text"],
.modal input[type="date"],
.modal input[type="email"],
.modal input[type="tel"],
.modal select,
.modal textarea {
  background: rgba(255, 248, 220, 0.9) !important; /* Warm beige/yellow background */
  border: 2px solid rgba(212, 165, 116, 0.4);
  color: #2a1512 !important; /* Dark text for readability */
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  padding: 10px 14px;
  border-radius: 6px;
}

.modal .form-control:focus,
.modal .form-select:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  background: rgba(255, 248, 220, 1) !important; /* Brighter beige on focus */
  border-color: var(--gold-text);
  color: #1a0d0a !important; /* Even darker on focus */
  box-shadow: 0 0 0 0.25rem rgba(212, 165, 116, 0.25);
  outline: none;
}

.modal .form-control::placeholder,
.modal input::placeholder,
.modal textarea::placeholder {
  color: rgba(42, 21, 18, 0.5) !important;
  opacity: 1;
}

/* --- Footer --- */
footer {
  position: relative;
  background: rgba(0, 0, 0, 0.5) !important;
  border-top: 2px solid rgba(212, 165, 116, 0.3) !important;
  backdrop-filter: blur(10px);
  margin-top: auto;
  padding: 30px 0;
}

.footer-text,
footer .container {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  text-align: center;
  color: var(--gold-text) !important;
  margin: 0;
  padding: 0;
}

/* --- Lilly Signature (Bottom Right, Smaller) --- */
.footer-signature {
  position: fixed;
  bottom: 60px;
  right: 40px;
  width: 180px; /* Increased from 120px */
  height: 90px; /* Increased from 60px */
  background-image: url('/images/lilly-signature.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.6;
  filter: brightness(0.85) sepia(0.3) contrast(1.1);
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* --- Text Color Overrides --- */
.text-muted {
  color: var(--gold-text) !important;
}

.text-dark {
  color: var(--gold-light) !important;
}

/* --- Badge --- */
.badge {
  background: var(--mahogany-accent);
  color: var(--gold-bright);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 4px;
}

/* --- Login Partial (User Menu) --- */
.navbar-nav.ms-auto {
  margin-left: auto !important;
}

.navbar-nav .dropdown-menu {
  background: var(--mahogany-darker);
  border: 1px solid var(--panel-border);
}

.navbar-nav .dropdown-item {
  color: var(--gold-light);
  font-family: 'Cormorant Garamond', serif;
}

.navbar-nav .dropdown-item:hover {
  background: rgba(212, 165, 116, 0.15);
  color: var(--gold-bright);
}

/* --- Modal Z-Index Fix --- */
/* Bootstrap modal defaults: backdrop=1040, modal=1050 */
/* We need to ensure nothing interferes with this hierarchy */

/* --- Modal Z-Index - Let Bootstrap Handle It --- */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.7) !important;
}
