/* ========================================
   FONT DEFINITIONS
   ======================================== */

/* Avenir-Light - Light weight font */
@font-face {
  font-family: 'Avenir-Light';
  src: url('/static/fonts/Avenir-Light.woff2') format('woff2'),
       url('/static/fonts/Avenir-Light.woff') format('woff');
  font-weight: 300; /* Light weight */
  font-style: normal;
  font-display: swap;
}

/* AvenirNext - Main body font family */
@font-face {
  font-family: 'AvenirNext';
  src: url('/static/fonts/AvenirNext-Regular.woff2') format('woff2'),
       url('/static/fonts/AvenirNext-Regular.woff') format('woff');
  font-weight: 400; /* Regular weight */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'AvenirNext';
  src: url('/static/fonts/AvenirNext-Medium.woff') format('woff');
  font-weight: 500; /* Medium weight */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'AvenirNext';
  src: url('/static/fonts/AvenirNext-DemiBold.woff2') format('woff2');
  font-weight: 600; /* DemiBold weight */
  font-style: normal;
  font-display: swap;
}

/* Didot - Heading font family */
@font-face {
  font-family: 'Didot';
  src: url('/static/fonts/didot-htf-l06-light.woff') format('woff');
  font-weight: 300; /* Light weight */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Didot';
  src: url('/static/fonts/Didot-Bold.woff2') format('woff2'),
       url('/static/fonts/Didot-Bold.woff') format('woff');
  font-weight: 700; /* Bold weight */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Didot-Bold';
  src: url('/static/fonts/Didot-Bold.woff2') format('woff2'),
       url('/static/fonts/Didot-Bold.woff') format('woff');
  font-weight: 700; /* Bold weight */
  font-style: normal;
  font-display: swap;
}

/* ========================================
   BASE STYLES
   ======================================== */

body {
  background-color: #eae8e5;
  font-family: 'AvenirNext', "Helvetica Neue", Helvetica, Arial, sans-serif; /* Main body font */
  color: #222;
  margin: 0;
  padding: 0;
}

/* ========================================
   HEADING STYLES
   ======================================== */

/* All headings use Didot font */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Didot', 'Times New Roman', serif; /* Heading font */
  font-weight: 700; /* Bold weight */
  text-transform: uppercase;
}

/* Override text-transform for navbar links */
.navbar a {
  text-transform: none;
}

a { 
  text-decoration: none; 
  color: #333; 
}

a:hover {
  color: #818181;
}

/* ========================================
   NAVIGATION STYLING
   ======================================== */

.navbar {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar a {
  padding: 6px 12px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
  font-size: 0.4em; /* Very small font size for navbar links */
}

.navbar a:hover {
  background-color: #f5f5f5;
}

.navbar a.active {
  background-color: #e8e8e8;
  color: #333;
}

/* ========================================
   LOGIN PAGE STYLING
   ======================================== */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f9f8f6 0%, #e8e6e3 100%);
}

.login-form {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
}

.login-form h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #2E8B57;
  font-family: 'Didot', 'Times New Roman', serif; /* Heading font */
  font-weight: 700; /* Bold weight */
}

.login-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px; /* Smaller font size */
  font-family: 'AvenirNext', "Helvetica Neue", Helvetica, Arial, sans-serif; /* AvenirNext font */
  font-weight: 400; /* Regular weight */
  box-sizing: border-box;
}

.login-form button {
  width: 100%;
  padding: 12px;
  background-color: #2E8B57;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px; /* Smaller font size */
  font-family: 'AvenirNext', "Helvetica Neue", Helvetica, Arial, sans-serif; /* AvenirNext font */
  font-weight: 500; /* Medium weight */
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.login-form button:hover {
  background-color: #b6b6b6;
}

/* ========================================
   PAGE CONTENT STYLING
   ======================================== */

.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px;
}

.page-title {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 90px;
  color: #1c1c1c;
  font-size: 2.8em; /* Larger heading size */
  font-family: 'Didot', 'Times New Roman', serif; /* Heading font */
  font-weight: 800; /*Bold weight */
}


/* ========================================
   CARD STYLING
   ======================================== */

.summary-card {
  text-align: center;
  padding: 25px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #f9f9f9;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.summary-card h3 {
  margin: 0;
  font-size: 2.2em; /* Larger heading size */
  font-family: 'Didot', 'AvenirNext', serif;
  font-weight: 700; /* Bold weight */
}

.summary-card p {
  margin: 5px 0 0 0;
  color: #666;
  font-size: 0.9em; /* Small text size */
}

/* ========================================
   TABLE STYLING
   ======================================== */

/* Global table styling for html.Table elements */
table {
  font-size: 14px; /* Control font size for all tables */
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-table th {
  background-color: #2E8B57;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600; /* DemiBold weight for headers */
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.data-table tr:hover {
  background-color: #f8f8f8;
}

/* ========================================
   CHART CONTAINER STYLING
   ======================================== */

.chart-container {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Plotly chart font styling */
.plotly-graph-div {
  font-family: 'Avenir-Light', 'AvenirNext', "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

.plotly-graph-div * {
  font-family: 'Avenir-Light', 'AvenirNext', "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

/* More specific Plotly selectors */
div[class*="plotly"] {
  font-family: 'Avenir-Light', 'AvenirNext', "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

div[class*="plotly"] * {
  font-family: 'Avenir-Light', 'AvenirNext', "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

/* Target specific Plotly elements */
.gtitle, .xtitle, .ytitle, .legend, .g-xtitle, .g-ytitle {
  font-family: 'Avenir-Light', 'AvenirNext', "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .page-content {
    padding: 10px;
  }
  
  .page-title {
    font-size: 2em; /* Smaller heading on mobile */
  }
  
  .summary-card {
    padding: 15px;
  }
  
  .summary-card h3 {
    font-size: 1.5em; /* Smaller card heading on mobile */
  }
  
  .navbar {
    flex-wrap: wrap;
  }
  
  .navbar a {
    padding: 8px 12px;
    font-size: 0.9em; /* Larger navbar text on mobile */
  }
}

/* ========================================
   LOADING AND ERROR STATES
   ======================================== */

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.error {
  text-align: center;
  padding: 40px;
  color: #DC143C;
  background-color: #ffe6e6;
  border-radius: 8px;
  margin: 20px 0;
}

/* ========================================
   MONOSPACE NUMERIC STYLING
   ======================================== */

/* Special styling for numerical values in headings */
.monospace-numeric {
  font-family: 'monospace' !important; /* Monospace font for numbers */
  font-weight: 200 !important; /* Very light weight */
  letter-spacing: 0.011em; /* Slight letter spacing */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased !important;
}

/* ========================================
   CUSTOM SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #797979;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b8b8b8;
}

/* ========================================
   MODIFY ENTRIES EXPANDER STYLING
   ======================================== */

details summary {
  list-style: none;
  outline: none;
  transition: all 0.2s ease;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary:hover {
  background-color: #e0ddd8;
}

details[open] summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background-color: #e0ddd8;
}

details[open] summary::after {
  content: "▼";
  float: left;
  color: "#6c757d";
  font-size: 9px; /* Small arrow size */
  margin-right: 9px; /* Separation from text */
}

details summary::after {
  content: "▶";
  float: left;
  color: "#6c757d";
  font-size: 9px; /* Small arrow size */
  margin-right: 9px; /* Separation from text */
}

/* ========================================
   FORM STYLING FOR MODIFY ENTRIES
   ======================================== */

.modify-entries input, .modify-entries select {
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modify-entries input:focus, .modify-entries select:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.modify-entries button {
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

.modify-entries button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.modify-entries button:active {
  transform: translateY(0);
}

/* Hide login button when TOTP section is visible */
.totp-section-visible .login-button {
  display: none;
}
