@font-face {
    font-family: 'Safiro';
    src: url('/fonts/safiro-regular-webfont.eot');
    src: url('/fonts/safiro-regular-webfont.eot?#iefix') format('embedded-opentype'),
        url('/fonts/safiro-regular-webfont.woff2') format('woff2'),
        url('/fonts/safiro-regular-webfont.woff') format('woff'),
        url('/fonts/safiro-regular-webfont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Safiro-italic';
    src: url('/fonts/safiro-regularitalic-webfont.eot');
    src: url('/fonts/safiro-regularitalic-webfont.eot?#iefix') format('embedded-opentype'),
        url('/fonts/safiro-regularitalic-webfont.woff2') format('woff2'),
        url('/fonts/safiro-regularitalic-webfont.woff') format('woff'),
        url('/fonts/safiro-regularitalic-webfont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Safiro-bold';
    src: url('/fonts/safiro-bold-webfont.eot');
    src: url('/fonts/safiro-bold-webfont.eot?#iefix') format('embedded-opentype'),
        url('/fonts/safiro-bold-webfont.woff2') format('woff2'),
        url('/fonts/safiro-bold-webfont.woff') format('woff'),
        url('/fonts/safiro-bold-webfont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Safiro-bold-italic';
    src: url('/fonts/safiro-bolditalic-webfont.eot');
    src: url('/fonts/safiro-bolditalic-webfont.eot?#iefix') format('embedded-opentype'),
        url('/fonts/safiro-bolditalic-webfont.woff2') format('woff2'),
        url('/fonts/safiro-bolditalic-webfont.woff') format('woff'),
        url('/fonts/safiro-bolditalic-webfont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'IBM-Plex-mono';
    src: url('/fonts/IBMPlexMono-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'IBM-Plex-mono-bold';
    src: url('/fonts/IBMPlexMono-Bold.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}



/****************** V A R I A B L E S ****************/

/* Light theme (default) variables */
:root {
	
	/******** F O N T S ********/
    
  --font-heading:          'Safiro-bold', Arial, sans-serif;
  --font-body:             'Safiro', Arial, sans-serif;
  --font-body-italic:      'Safiro-italic', Arial, sans-serif;
  --font-data:             'IBM-Plex-mono', mono;
  --font-data-bold:        'IBM-Plex-mono-bold', mono;

  /********  S I T E  C O L O R S  ********/

  --dark-bg:                    #1a1a1a;
	
	/********  T H E M E   C O L O R S  ********/
	
  /* Light theme (default) variables */
	--main-bg-color:	     	    	#f9f8f6;
  --light-blue:       	        #d4eced;
	--blue: 				   	         	#8AB8C4;
	--mid-blue:			    	     		#6E8C9A;
	--dark-blue: 		           		#295062;
	
	--beige: 				             	#E8E3DA;
  --mid-beige:                  rgb(164, 167, 148);
	--dark-beige:			          	rgb(116, 118, 105);
	
	--separator-gray: 		       	rgba(0, 0, 0, 0.2);
	--separator-mid-gray: 	    	rgba(0, 0, 0, 0.1);
	--separator-light-gray:     	rgba(0, 0, 0, 0.05);
	--dark-gray: 	      		    	#555;
	--gray: 			        	    	#999;
	--light-gray: 	    	    		#ddd;
	
	--form-bg: 			          		rgba(255,255,255,0.8);
	--box-bg: 		      	    		rgba(255,255,255,0.9);
  --modal-bg:                   rgba(0,0,0,0.5);
	
	--white:				            	#fff;
	--success: 			          		green;
	--success-bg:		           		#d4edda;
	--warning: 			           		#856404;
	--warning-bg:                 #ffa;
  --critical:                 #dc3545;
  --critical-bg:              #fbb;

  /* Chart color scheme - 9 semantic colors */
  /* Positive (success/growth) */
  --chart-positive-light:       #4caf50;
  --chart-positive:             #28a745;
  --chart-positive-dark:        #1e7e34;

  /* Neutral (informational) */
  --chart-neutral-light:        #00bcd4;
  --chart-neutral:              #17a2b8;
  --chart-neutral-dark:         #117a8b;

  /* Negative (warning/decrease) */
  --chart-negative-light:       #ffc107;
  --chart-negative:             #ff9800;
  --chart-negative-dark:        #e65100;

  /* Chart grid lines */
  --chart-grid-vertical:        rgba(0, 0, 0, 0.15);
  --chart-grid-horizontal:      rgba(0, 0, 0, 0.08);

  /* Product-specific colors */
  --chart-bottles-light:        #84b8d4;
  --chart-bottles:              #6ba3c4;
  --chart-bottles-dark:         #4d89ae;

  --chart-packages-light:       #b968c7;
  --chart-packages:             #9b59b6;
  --chart-packages-dark:        #8e44ad;

  --chart-glasses-light:        #26c6da;
  --chart-glasses:              #00bcd4;
  --chart-glasses-dark:         #0097a7;

  /* Text colors */
  --text-primary:             #182125;
  --text-secondary:           #555;
  --text-muted:               #999;
  --text-hover:               #f9f8f6;
  
  /* Content backgrounds */
  --content-bg-primary:       #fff;
  --content-bg-secondary:     #f9f8f6;
  --card-bg:                  #fff;
  --card-shadow:              0 1px 3px rgba(0,0,0,0.1);
  --box-shadow:               -5px 0 15px rgba(0, 0, 0, 0.1);
  
  /* Table specific colors */
  --table-header-bg: var(--beige);
  --table-row-hover: var(--separator-light-gray);
  --table-border: var(--separator-light-gray);
  --table-bg:                 rgba(0,0,0,0.05);
  
  /* Navigation */
  --navigation-hover: var(--separator-light-gray);
  --navigation-active: var(--light-blue);
  
  /* WIDTHS */
  --width-superwidescreen:         2860px;
  --width-widescreen:              1500px;
  --width-desktop:                 1280px;
  --width-tablet:                  700px;
  --width-mobile:                  540px;
  
  /* Dark theme variables */
  body[data-theme="dark"] {
    /* Background colors */
    --main-bg-color:              #1a1a1a;
    --light-blue:                 #1e3a3c;
    /* --blue:                       #5f8a94;
    --mid-blue:                   #4d6977;
    --dark-blue:                  #152b35;
    */

    --blue: 				   	         	#152b35;
    --mid-blue:			    	     		#4d6977;
    --dark-blue: 		           		#5f8a94;
    
    --beige:                      #2c2c27;
    --mid-beige:                  rgb(114, 116, 101);
    --dark-beige:                 rgb(84, 86, 75);
    
    /* Gray shades */
    --separator-gray:             rgba(255, 255, 255, 0.2);
    --separator-mid-gray:         rgba(255, 255, 255, 0.1);
    --separator-light-gray:       rgba(255, 255, 255, 0.05);
    --dark-gray:                  #aaa;
    --gray:                       #777;
    --light-gray:                 #444;
    --box-shadow: -5px 0 15px     rgba(255, 255, 255, 0.1);
    
    /* Backgrounds */
    --form-bg:                    rgba(30, 30, 30, 0.8);
    --box-bg:                     rgba(20, 20, 20, 0.95);
    --box-bg-hover:               rgba(10, 10, 10, 0.95);
    --modal-bg:                   rgba(0, 0, 0, 0.75);
    
    /* Base colors */
    --white:                      #1a1a1a;  /* Inverted for dark mode */
    --black:                      #f5f5f5;  /* Inverted for dark mode */
    
    /* Status colors - slight modifications to be visible on dark backgrounds */
    --success:                    #4caf50;
    --success-bg:                 #09420d;
    --warning:                    #ffc107;
    --warning-bg:                 #220;
    --critical:                   #f44336;
    --critical-bg:                #200;

    /* Chart color scheme - adjusted for dark mode visibility */
    /* Positive (success/growth) */
    --chart-positive-light:       #66bb6a;
    --chart-positive:             #4caf50;
    --chart-positive-dark:        #388e3c;

    /* Neutral (informational) */
    --chart-neutral-light:        #26c6da;
    --chart-neutral:              #00bcd4;
    --chart-neutral-dark:         #0097a7;

    /* Negative (warning/decrease) */
    --chart-negative-light:       #ffca28;
    --chart-negative:             #ffa726;
    --chart-negative-dark:        #f57c00;

    /* Chart grid lines */
    --chart-grid-vertical:        rgba(255, 255, 255, 0.18);
    --chart-grid-horizontal:      rgba(255, 255, 255, 0.10);

    /* Product-specific colors - adjusted for dark mode */
    --chart-bottles-light:        #9bc9e0;
    --chart-bottles:              #84b8d4;
    --chart-bottles-dark:         #6ba3c4;

    --chart-packages-light:       #c77cd6;
    --chart-packages:             #b968c7;
    --chart-packages-dark:        #9b59b6;

    --chart-glasses-light:        #4dd0e1;
    --chart-glasses:              #26c6da;
    --chart-glasses-dark:         #00bcd4;

    /* Text colors */
    --text-primary:               #d1d1d1;
    --text-secondary:             #b0b0b0;
    --text-muted:                 #808080;
    --text-hover:                 #222;
    
    /* Content backgrounds */
    --content-bg-primary:          #2a2a2a;
    --content-bg-secondary:        #222;
    --card-bg:                     #2a2a2a;
    --card-shadow:                 0 1px 3px rgba(0,0,0,0.3);
    
    /* Table specific colors */
    --table-header-bg:             #191e28;
    --table-row-hover:             rgba(255, 255, 255, 0.05);
    --table-border:                #333;
    --table-bg:                    rgba(20, 20, 20, 0.95);
    
    /* Navigation */
    --navigation-hover: var(--separator-light-gray);
    --navigation-active: var(--dark-blue);
	
  }
}

/****************** U S E R  A G E N T  S T Y L E  R E S E T S  *********/

h1, h2, h3, h4, h5, h6, body {
  margin: 0;
}

/****************** G E N E R A L *********************/

/* Theme transition for smooth dark mode toggling */
body, body * {
 /* transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; */
}

body { 
  color: var(--text-primary);
  background-color: var(--main-bg-color);
  font-size: 12px;
  line-height: 1.1;
  /* padding: 5%; */
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  
  header {
    justify-content: space-between;
    align-items: top;
    margin-bottom: 40px;
      /* padding: 5%;
      width: 90%;
      max-width: 1440px;
      margin: 0 auto; */
      
      /*
      @media (max-width: 540px) {
        padding: 10%;
        width: 80%;
      }
      */
      /* padding-right: 80px; /* Make space for the menu toggle button */
      
      button {
        height: auto;
        box-sizing: border-box; 
      }
        
      h1 {
        margin-bottom: 10px;
      }
    
    .button-group {
      margin: 0;
      height: 30px;
    }
    
    .logo {
      width: 120px;
      height: auto;
    }
  }
  
  footer {
    color: var(--mid-blue);
    justify-content: space-between;
    padding: 8%;
    margin-top: 8%;
    border-top: 1px solid var(--separator-gray);

    .logo {
      height: 30px;
      width: auto;
      margin: 0;
    }
  }
  
  &.index {
	
  }
  
  &.login {

    header {
      margin-bottom: 0;
		    .logo {
			    margin-bottom: 0;
		    }
    }
  
    .login-container {
      max-width: 400px;
      margin: 0 auto;
      padding: 38vh 0 0 0;
      border-radius: 5px;
      width: 80%;
      height: 50vh;
      /* align-items: center; */
      display: flex;
      flex-direction: column;

      form {
	      width: 100%;
      }
    }
    .form-group { 
      margin-bottom: 15px; 
    }
    label { 
      display: block; 
      /* margin-bottom: 5px; */
    }
    input[type="text"],
    input[type="password"] {
      width: 100%;
      padding: 8px;
      border: 1px solid var(--light-gray);
      border-radius: 4px;
    }
    .error { color: var(--critical); margin-bottom: 15px; }
  }
  
  &.admin {
    
    padding: 5%;
    
    header {
    
        .branding {
          
          align-items: center;
          
          .logo-symbol {
            width: 30px;
            height: auto;
            margin-right: 10px;
          }
          
          h1 {
            font-size: 20px;
            margin-bottom: 0 !important;
            
            @media (max-width: 540px) {
              font-size: 16px;
            }
          }
        }
      
    }
    
    tr:hover {
        background-color: var(--table-row-hover);
      }
    
    th { 
      background-color: var(--table-header-bg);
      color: var(--text-primary);
      padding: 10px 8px;
      text-align: left;
      font-size: 10px;
    }
    td {
      /* border: 1px solid #ccc; */
      padding: 10px 8px;
      text-align: left;
          border-bottom: 1px solid var(--table-border);

      &.inventory, &.right {
        text-align: right;
      }

      .button-group {
        margin-top: 5px;
        margin-bottom: 5px;
      }

    }

    /* Volume remaining display in inventory cells */
    .volume-remaining {
      color: var(--text-muted);
      font-size: 11px;
      display: block;
      margin-top: 3px;
    }

    /* Volume remaining in edit forms */
    .volume-remaining-edit {
      color: var(--text-muted);
      font-size: 11px;
      display: block;
      margin-top: 5px;
    }
    
    .purchasePrice, .sellPrice, .totalValue {
      text-align: right;
    }
    
    footer {
      height: auto;
      padding: 50px 0 0 0;
    }
    
  }

}

table { 
  /* background-color: var(--content-bg-primary); 
  background-color: var(--table-bg); */
  border-collapse: collapse;
  width: 100%;
  font-size: inherit;

  th.sortable {
    &.asc:after {
      content: "▼";
    }

    &.desc:after {
      content: "▲";
    }
  }

  tr {
    width: 100%;
    border-bottom: 1px dashed var(--separator-gray);
    
    &.edit-form {
      &:hover {
        background-color: var(--table-row-hover);
      }
    }
    
    td {
      padding: 8px 40px 8px 0;
      border-bottom: 1px solid var(--table-border);
    }
    
    /* NOT USED?
    &.rowHeader {
      font-weight: 700;
      letter-spacing: 1px;
      font-size: 90%;
      background-color: transparent;
      border-bottom: 2px solid var(--separator-mid-gray);
      
      th {
        text-transform: uppercase !important;
        padding: 8px 40px 8px 0;
      }
    } */
  }

}


li {
  margin-right: 30px;
  padding: 5px 0;
  /* min-width: 100px;
  max-width: 250px;
  text-transform: capitalize; */
  
  &.country { min-width: 70px }
  &.region { min-width: 100px; max-width: 100px; }
  &.year { min-width: 50px }
  &.producer { min-width: 150px; max-width: 150px; }
  &.article { min-width: 300px }
  &.price { min-width: 50px }	
}

p {
  margin-bottom: 10px;
}

/*
.container {
  background-color: white;
  padding: 28px;
  border-radius: 13px;
}
*/


h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--mid-beige);
  
  span {
    color: var(--blue);
  }
}

h1 {
	font-size: 45px;
}

h2 {
  font-size: 34px;
}

h3 {
	color: var(--mid-blue);
	font-size: 20px;
	margin-bottom: 20px;
}
h4 {
	color: var(--dark-blue);
	font-size: 16px;
	margin-top: 50px;
	margin-bottom: 20px;
}

i {
	color: var(--gray);
    font-family: var( --font-body-italic);
}

.value {
  font-weight: 700;
  font-family: var(--font-data);
  color: var(--mid-blue);

  &.medium {
    font-size: 20px;
  }

  &.large {
    font-size: 25px;
  }
}

hr {
	/* padding: 20px 0; */
	margin: 20px 0;
	background: var(--separator-gray);
	border: none;
	height: 1px;
	
}

.separator {
  font-family: var(--font-data);
  letter-spacing: 3px;
  font-size: 80%;
  text-transform: uppercase;
  color: var(--separator-gray);
  border-top: 1px solid #ccc;
  width: 100%;
  display: block;
  padding-top: 20px;
}

a {
  color: var(--dark-beige);
  
  &:hover {
    color: inherit;
  }
}

.chip {
  background-color: var(--light-blue);
  padding: 2px 5px;
  border-radius: 5px;
}

.badge {
  background-color: var(--mid-blue);
  color: var(--text-primary);
  padding: 3px 5px;
  border-radius: 5px;

  &.success {
    background-color: var(--success-bg);
  }

  &.warning {
    background-color: var(--warning-bg);
  }
  &.error {
    background-color: var(--critical-bg);
  }

  &.disabled {
    background-color: var(--gray);
  }
}



.icon, svg.icon {
  margin-left: 5px;
  height: 12px;
  width: 12px;
  vertical-align: bottom;
  color: var(--mid-blue);
  
  &.large {
    height: 18px !important;
    width: 18px !important;
  }

  &.delete {
    height: 18px !important;
    width: 18px !important;
  }

  &.edit {
    height: 13px !important;
  }

  &.hidden {
    height: 14px;
    width: 26px;
    color: var(--critical);
  }
  
  &:hover {
    /* color: white; */
  }  
}

.has-icon > img.icon, .has-icon > svg.icon {
  margin-right: 7px;
  margin-left: 0;
}

.button-group {
  margin-top: 5px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: row;
  gap: 10px;

  &.stacks-mobile {
    @media (max-width: 540px) {
      flex-direction: column;
    }
  }
} 

button {
  text-wrap: nowrap;
  padding: 5px 10px 5px 10px;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  display: flex;
  align-items: center;
  font-family: inherit;
  height: max-content;

  &.large {
    font-size: 16px;
    padding: 10px 15px;
  }
  
  &:disabled,
  &[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
  }
  
  a {
    color: inherit;
    text-decoration: none;
  }
  
  &.circular {
    padding: 3px 8px 3px 8px;
  }
  
  &.small {
    padding: 4px 7px;
    font-size: 80%;
    
    .icon {
      scale: 0.7;
      margin-left: 0;
    }
  }

  &.primary {
    background-color: var(--mid-blue);
    color: #fff;
    border: 1px solid var(--mid-blue);
    
    .icon {
      color: inherit;
      opacity: 0.8;
    }
  
    &:hover {
      background-color: var(--dark-blue);
      border: 1px solid var(--dark-blue);
      
      .icon {
        color: white;
        opacity: 1;
      }
    }

    &.mobile-large {
        @media (max-width: 540px) {
          font-size: 16px;
          padding: 10px 15px;
      }
    }
  }
  
  &.secondary {
    border-style: solid;
    border-width: 1px;
    border-color: var(--mid-blue);
    color: var(--text-primary);
    background: transparent;
    
    + p {
      margin-top: 20px;
    }
    
    .icon {
      color: inherit;
      opacity: 0.8;
    }
    
    &:hover {
      background-color: var(--dark-blue);
      border: 1px solid var(--dark-blue);
      color: var(--text-hover);
      
      .icon {
        color: white;
        opacity: 1;
      }
    }
  }
  
  &.tertiary {
    background-color: transparent;
    color: var(--dark-beige);
    
    &:hover {
      color: var(--dark-blue);
    }
    
    .icon {
      height: 8px;
      margin-left: 0;
      margin-right: 5px;
      /* width: auto; */
      vertical-align: middle;
    }
  }
  
  &.critical {
    border: 1px solid var(--critical);
    color: var(--critical);
    background: transparent;
    
    &:hover {
      background: var(--critical);
      color: var(--white);
      border: 1px solid var(--critical);
    }
  }

  &.tab {
    border-radius: 0 !important;
  }
  
}



.logo {
  width: 200px;
  margin-bottom: 50px;
}

/*****************************************
********** N A V I G A T I O N ***********
******************************************/

/* Global Navigation Styles */

/* Menu Toggle Button */
.menu-toggle {
    /*
    position: fixed;
    top: 20px;
    right: 20px;
    */
    position: relative;
    z-index: 998;
    display: flex;
    align-items: center;
    background-color: var(--light-blue);
    border: 1px solid var(--blue);
    color: var(--dark-blue);
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.menu-toggle:hover {
    background-color: var(--dark-blue);
    color: white;
}

.menu-icon {
    width: 18px;
    height: 18px;
    margin-right: 6px;
}

/* Navigation Overlay */
.navigation-overlay {
    position: fixed;
    top: 0;
    right: -450px; /* Start off-screen */
    width: 100%;
    max-width: 450px;
    height: 100vh;
    background-color: var(--main-bg-color);
    z-index: 999;
    transition: right 0.3s ease;
    box-shadow: var(--box-shadow);
}

.navigation-overlay.open {
    right: 0;
}

/* Navigation Panel */
.navigation-panel {
    position: absolute;
    top: 0;
    right: 0;
    /* height: 100%; */
    bottom: 0;
    width: 80%;
    background-color: var(--main-bg-color);
    padding: 10%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Navigation Header */
.navigation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.navigation-header h3 {
    margin: 0;
    color: var(--mid-blue);
}

.close-menu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.close-icon {
    width: 16px;
    height: 16px;
}

/* Navigation Menus */
.global-nav, .view-nav {
    margin-bottom: 20px;
}

.nav-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 10px;
    margin-right: 0;
    width: 100%;
    max-width: none;
}

.nav-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    font-size: 1.3rem;
}

.nav-link:hover {
    background-color: var(--navigation-hover);
    color: var(--text-primary);
}

.nav-icon {
    width: 25px;
    height: 25px;
    margin-right: 10px;
}

/* Separator */
.nav-separator {
    height: 1px;
    background-color: var(--separator-gray);
    margin: 15px 0;
}

.view-nav {
  .separator {
    margin-bottom: 20px;
  }
}

/* Navigation footer */
.nav-footer {
    margin-top: auto;
    padding-top: 20px;
}

.user-info {
    margin-bottom: 10px;
}

.user-link, .logout-link {
    display: flex;
    align-items: center;
    color: var(--dark-beige);
    text-decoration: none;
    padding: 5px 0;
}

.user-link:hover, .logout-link:hover {
    color: var(--dark-blue);
}

.user-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.logout-link {
    color: var(--critical);
    font-size: 14px;
}

.logout-link:hover {
    color: var(--critical);
    text-decoration: underline;
}

@media (max-width: 540px) {
    .navigation-overlay {
        max-width: 100%;
    }
    
    .navigation-panel {
        width: 85%;
        padding: 5% 5% 100px 5%;
    }
}

/* Additional Styles for the Header with Global Navigation */

.action-buttons {
    display: flex;
    align-items: flex-start;
}

/* Active navigation link style */
.nav-link.active {
    background-color: var(--navigation-active);
    /* color: var(--navigation-link-active);
    font-weight: bold; */
}

/* Responsive adjustments */
@media (max-width: 700px) {
    body.admin header {
        /* flex-direction: column;
        align-items: flex-start; */
    }
    
    .action-buttons {
        /* margin-top: 15px;
        width: 100%;
        justify-content: flex-start; */
    }
}

@media (max-width: 540px) {
    body.admin header h1 {
        font-size: 26px;
    }
    
    .menu-toggle {
        /* top: 15px;
        right: 15px;
        padding: 6px 10px; */
        font-size: 12px;
    }
    
    .menu-icon {
        width: 16px;
        height: 16px;
    }
}



/****** Responsive Table Styles *****/

@media (max-width: 700px) {
    /* Hide table headers on mobile */
    
    .responsive-table {
      
      /* Hide desktop table headers */
      thead, .rowHeader {
          display: none !important;
      }
      
      /* Make each row display as a card */
      tbody {
        tr {
          /* display: block !important; */
          margin-bottom: 15px !important;
          padding: 3% !important;
          background-color: var(--content-bg-primary) !important;
          color: var(--text-primary);
          border-radius: 6px !important;
          box-shadow: 0 1px 3px rgba(0,0,0,0.1);
          position: relative !important;
          width: 94% !important;
          transition: max-height 0.3s ease-out !important;
          overflow: hidden !important;
          border-bottom: none;
        }
      }
      
      /* Hide desktop edit form */
      tr.edit-form {
        display: none !important;
      }
      
      .collapsed {
        .edit-button {
          display: none;
        }
      }
      
      .expanded {
        .edit-button {
          display: block;
        }
      }
    }
    
    
    /* All rows start with collapsed class */
    /* This is needed sos that all other, less data intense tables don't get their content hidden */
    .responsive-table.excessive-data tbody tr.collapsed td:not(.category):not(.country):not(.article):not(:last-child) {
      display: none !important;
    }
    
    
    /* Expanded state overrides collapsed */
    .responsive-table tbody tr.expanded td {
        display: flex !important;
    }
    
    /* Make each cell display as a row with label */
    .responsive-table td {
        display: flex !important;
        justify-content: space-between !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid var(--table-border) !important;
        text-align: right;
        width: 100% !important;
    }
    
    /* Add data labels using attributes */
    .responsive-table td:before {
        content: attr(data-label) !important;
        font-weight: bold !important;
        text-align: left !important;
        padding-right: 10px !important;
        color: var(--dark-gray) !important; /* Change for dark mode? */
    }
    
    /* Remove border from last cell */
    .responsive-table td:last-child {
        border-bottom: none !important;
    }

    /* Style the edit button */
    .edit-button {
        /* position: absolute !important;
        top: 10px !important;
        right: 10px !important; */
        position: relative;
    }

    /* Add special styling for wine name */
    .responsive-table td.article {
        font-weight: bold !important;
        font-size: 16px !important;
        padding-top: 10px !important;
        padding-right: 30px !important; /* Make room for edit button */
    }

    /* Special styling for badges on mobile */
    .articleWrapper .badge {
        display: inline-block !important;
        margin-top: 5px !important;
    }
    
    /* Add expand/collapse indicator */
    .responsive-table tr .expand-indicator {
        /* position: absolute !important;
        bottom: 12px !important;
        right: 12px !important; */
        position: relative;
        color: var(--mid-blue) !important;
        cursor: pointer !important;
        font-size: 12px !important;
        background: rgba(255,255,255,0.8) !important;
        padding: 4px 8px !important;
        border-radius: 4px !important;
        display: block !important;
    }
}

/***** Mobile edit drawer ******/

/* Styles as a drawer docked to the bottom
.mobile-edit-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 85%;
    max-height: 85vh;
    background: white;
    z-index: 1000;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
}
*/

.mobile-edit-drawer {
    background-color: var(--content-bg-primary);
    color: var(--text-primary);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    max-height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding: 20px;
    border-radius: 0;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    
    #editForm {
      padding-bottom: 50px;
    }
}

.mobile-edit-drawer.open {
    transform: translateY(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--separator-gray);
}

.drawer-header h2 {
    margin: 0;
    font-size: 20px;
}

/* Overlay for background when drawer is open */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 999;
}

.overlay.active {
    display: block;
}

@media (max-width: 700px) {
    .mobile-button-container {
        display: flex;
        justify-content: space-between;
        width: 100%;
        margin-top: 10px;
    }
    
    /* Make sure the buttons are appropriately sized */
    .mobile-button-container button {
        /* padding: 6px 10px;
        font-size: 12px; */
    }
}




/*****************************************
********** GENERIC FORM STYLING **********
******************************************/

.form-group {
	margin-bottom: 15px;
	
	label {
		display: block;
		margin-bottom: 5px;
		color: var(--dark-gray);
	}
	
	input {
		width: 100%;
		padding: 8px;
		box-sizing: border-box;
	}
}

.twoColForm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 50px;
  
  @media (max-width: 540px) {
    grid-template-columns: 1fr;
    grid-gap: 0px;
  }
}

.fourColFormGroup {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-gap: 20px;
  
  @media (max-width: 540px) {
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
  }
}

.twoColFormGroup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 20px;	
  
  @media (max-width: 540px) {
    grid-template-columns: 1fr;
    grid-gap: 0px;
  }
  
}

select {
    background-color: var(--form-bg);
    color: var(--text-primary);
	padding: 7px;
	border: 1px solid var(--light-gray);
	border-radius: 4px;
	margin-bottom: 0;
	width: auto;
} 

input[type="checkbox"] {
	width: auto !important;
	margin-right: 5px;
	
	+ label {
		display: inline-block;
		color: inherit;
		font-family: inherit;
		font-size: inherit;
		/* margin-bottom: 0; */
	}
}

input[type="color"] {
  padding: 0;
  height: 2rem;
  width: 2rem;
}

input, textarea {
    background-color: var(--form-bg);
    color: var(--text-primary);
    border-color: var(--light-gray);
    padding: 10px;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    margin-bottom: 0;
    display: inline-block;
    font-size: 0.75rem;
    width: auto;
    box-sizing: border-box;
    
    &[type="radio"] {
	  width: auto !important;
    }
    
    &.small {
      padding: 5px 8px;
    }
}

textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 115px;
}

input::placeholder, textarea::placeholder, select::placeholder  {
  font-family: var( --font-body-italic);
  color: var(--text-muted);
}

label {
	display: block;
	/* margin-bottom: 5px; */
	color: var(--gray);
	font-family: var(--font-data);
	font-size: 9px;
  
    &:has(> input) {
      display: inline-block;
      color: inherit;
      font-family: inherit;
      font-size: inherit;
     /* margin-bottom: 0; */
    }
}

strong {
  font-family: var(--font-heading);
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);

    &.settings {
      padding: 1rem 2rem 2rem 2rem;
    }

    h4 {
        margin-bottom: 0.5rem;
        color: var(--gray);
        font-size: 16px;
        margin-top: 6px;
        margin-bottom: 20px;
        font-family: var(--body-font);
    }

    p {
        margin: 0 0 20px 0;
    }

    .button-group {
      margin: 0 auto;
      width: fit-content;
    }
}


/********** CUSTOM FORM ELEMENTS *********/



/* Custom Checkbox */
.custom-checkbox {
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  user-select: none;
  display: inline-flex !important;
  align-items: center;

  &.small {
    
    padding-left: 24px;
    
    .checkbox-mark {
      height: 15px;
      width: 15px;
    }
    
    .checkbox-mark:after {
      left: 5px;
      top: 1px;
      width: 3px;
      height: 8px;
    }
  }
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/*
&.primary {
background-color: var(--mid-blue);
color: #fff;
border: 1px solid var(--mid-blue);

&:hover {
  background-color: var(--dark-blue);
  border: 1px solid var(--dark-blue);
}
*/

.checkbox-mark {
  background-color: var(--form-bg);
  border: 1px solid var(--mid-blue);
  position: absolute;
  left: 0;
  height: 20px;
  width: 20px;
  border-radius: 4px;
  transition: all 0.2s ease; 
}

.custom-checkbox:hover .checkbox-mark {
  border: 1px solid var(--dark-blue);
}

.custom-checkbox input:checked ~ .checkbox-mark {
  background-color: var(--mid-blue);
  border: 1px solid var(--mid-blue);
  
  &:hover {
    background-color: var(--dark-blue);
  }
}

.checkbox-mark:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkbox-mark:after {
  display: block;
}


/* Custom Select */
.custom-select {
  position: relative;
  display: inline-block;
  width: 200px;
}

.custom-select select {
  background-color: var(--form-bg);
  color: var(--text-primary);
  appearance: none;
  -webkit-appearance: none;
  /* width: auto; */
  width: inherit;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--light-gray);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.custom-select:after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--light-gray);
  pointer-events: none;
}

.custom-select select:hover,
.custom-select select:focus {
  border-color: var(--light-gray);
}

.custom-select select:focus {
  outline: none;
  box-shadow: var(--card-shadow);
}


/* Custom Radio Button */

.radio-group {
  margin-bottom: 15px;
}

.custom-radio {
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  margin: 16px 0;
  height: 20px;
}

.custom-radio input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.radio-mark {
  background-color: var(--form-bg);
  border: 1px solid var(--mid-blue);
  position: absolute;
  left: 0;
  top: -5px;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.custom-radio:hover .radio-mark {
  border-color: var(--mid-blue);
}

.custom-radio input:checked ~ .radio-mark {
  border-color: var(--mid-blue);
}

.radio-mark:after {
  background: var(--mid-blue);
  content: "";
  position: absolute;
  display: none;
  left: 4px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.custom-radio input:checked ~ .radio-mark:after {
  display: block;
}


/* Custom Switch */
.custom-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.custom-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.custom-switch input:checked + .switch-slider {
  background-color: #1D393B;
}

.custom-switch input:checked + .switch-slider:before {
  transform: translateX(24px);
}

/* Disabled States */
.custom-checkbox input:disabled ~ .checkbox-mark,
.custom-radio input:disabled ~ .radio-mark,
.custom-select select:disabled,
.custom-switch input:disabled + .switch-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Focus States */
.custom-checkbox input:focus ~ .checkbox-mark,
.custom-radio input:focus ~ .radio-mark {
  box-shadow: 0 0 0 3px rgba(29, 57, 59, 0.2);
}


/********** In app guidance and info **********/

.info-box {
  margin-bottom: 30px;
  color: var(--gray);
  display: flex;
  flex-direction: row;
  gap: 30px;

  .info-text {
    flex: 1;
  }
  
  .info-image {
    width: 200px;
    /* background-color: #ccc; */
    position: relative;
    flex-shrink: 0;

    img {
      width: 100%;
      height: auto;
    }   

    lottie-player {
      width: 160px;
      position: absolute;
      top: -12px;
      right: 0;
      height: 150px;
    }
  }
  
}

.container {
  
  &.boxed {
    background-color: var(--box-bg);
    color: var(--text-primary);
    padding: 20px;
    border-radius: 10px;

    &.padding-large {
      padding: 35px;
    }
    
    @media (max-width: 700px) {
      padding: 5%;
      width: 90%;
    }
  }
}

/**** Tooltips ****/

/* tooltip.css - Styling for the tooltip system */

/* Tooltip trigger styling */
[data-tooltip] {
    position: relative;
    cursor: help;
    display: inline-block;
    padding: 2px 4px;
    margin: -2px -4px;
}

[data-tooltip][data-tooltip-trigger="click"] {
    cursor: pointer;
}

/* Tooltip active state */
.tooltip-active {
    z-index: 1001;
    position: relative;
}

/* Tooltip container */
.tooltip-container {
    position: absolute;
    z-index: 1100;
    max-width: 300px;
    background-color: var(--box-bg);
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    padding: 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.tooltip-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Position-specific styling */
.tooltip-top:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

.tooltip-bottom:after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.tooltip-left:after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid white;
}

.tooltip-right:after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid white;
}

/* Content styling */
.tooltip-content {
    padding: 8px 15px;
    color: var(--text-primary);
    line-height: 1.4;
}

.tooltip-heading {
    margin: 3px 0 8px 0;
    font-size: 13px;
    font-weight: bold;
    color: var(--dark-blue);
    font-family: var(--font-heading, inherit);
}

.tooltip-text {
    margin-bottom: 3px;
}

.tooltip-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 4px;
}

.tooltip-button {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    background-color: var(--mid-blue, #6E8C9A);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tooltip-button:hover {
    background-color: var(--dark-blue, #295062);
}

/* Close button for click tooltips */
.tooltip-close {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--gray, #999);
    opacity: 0.7;
}

.tooltip-close:hover {
    opacity: 1;
}

/* Overlay for click tooltips */
.tooltip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

/* Helper icon for tooltip triggers
[data-tooltip]::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url('/imgs/app/help.svg');
    background-size: contain;
    background-repeat: no-repeat;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.7;
}

[data-tooltip]:hover::after {
    opacity: 1;
}
*/

/* Hide helper icon if specified 
[data-tooltip][data-tooltip-icon="none"]::after {
    display: none;
}

/* Custom icon if specified 
[data-tooltip][data-tooltip-icon="custom"]::after {
    background-image: url(attr(data-tooltip-icon-url));
}

/* Dark theme tooltip - add data-tooltip-theme="dark" to trigger */
.tooltip-container[data-theme="dark"] {
    background-color: var(--dark-blue, #295062);
    color: white;
}

.tooltip-container[data-theme="dark"] .tooltip-heading {
    color: white;
}

.tooltip-container[data-theme="dark"] .tooltip-close {
    color: rgba(255, 255, 255, 0.7);
}

.tooltip-container[data-theme="dark"].tooltip-top:after {
    border-top-color: var(--dark-blue, #295062);
}

.tooltip-container[data-theme="dark"].tooltip-bottom:after {
    border-bottom-color: var(--dark-blue, #295062);
}

.tooltip-container[data-theme="dark"].tooltip-left:after {
    border-left-color: var(--dark-blue, #295062);
}

.tooltip-container[data-theme="dark"].tooltip-right:after {
    border-right-color: var(--dark-blue, #295062);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .tooltip-container {
        max-width: 250px;
    }
    
    /* On mobile, prefer bottom position for better visibility */
    .tooltip-top {
        top: auto !important;
        bottom: calc(100% + 15px) !important;
    }
}

/********** WINE SETTINGS FORM STYLING *********/

body.winelist-settings {

  /*
  .category-management-table {
      width: 100%;
      margin-bottom: 20px;
  }

  .category-management-table th {
      text-align: left;
      padding: 8px;
      background-color: var(--color-background-alt);
  }

  .category-management-table td {
      padding: 8px;
      border-bottom: 1px solid var(--color-border);
  }
      */



  .category-management-table {

    @media (max-width: 700px) {

      tbody {
        display: block !important;
        width: 100%;
      }
      
      .has-region {
        display: block !important;
      }

      .region-settings-container {
        margin: 0 0 40px 0;
      
        h4 {
          margin: 0 0 10px 0 !important;
        }
      }
  
      .region-settings-table {
          td {    
            &:before {
              display: none !important;
            }
          }      
      }
    
    }

    td.list-by-country {

      .mini-button, .badge {
        display: inline-block;
      }
    }

    th {
      &.name { width: 25%; }
      &.display-name { width: 25%; }
      &.count { width: 10%; }
      &.country { width: 20%; }
      &.action { width: auto; }
    }

    td {
      &.name { width: 25%; }
      &.display-name { width: 25%; }
      &.count { width: 10%; text-align: center; }
      &.country { width: 20%; text-align: center; }
      &.action { width: auto; }
    }
    
    .edit-field {
      width: 100%;
      box-sizing: border-box;
    }

    .actions {
      white-space: nowrap;
      text-align: right;
    }

  }

  .region-settings-row {
    box-shadow: 0px -15px 20px -28px rgba(0,0,0,0.58) inset;
    -webkit-box-shadow: 0px -15px 20px -28px rgba(0,0,0,0.58) inset;
    -moz-box-shadow: 0px -15px 20px -28px rgba(0,0,0,0.58) inset; 
  }

  tr.region-settings-row:hover {
      background-color: transparent;
  }

  .region-settings-container {
    background-color: var(--color-neutral-100);
    padding: 0 0 0 15px !important;
    border-radius: 4px;
    margin: 0 0 20px 0;
    display: block !important;
  
    h4 {
      margin: 20px 0 10px 0 !important;
    }

    th {
      background-color: transparent;
    }
  }


  .region-settings-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;

    tr {
      box-shadow: none;
      text-align: left;
      margin-bottom: 2px !important;
      padding: 0 !important;
      display: flex !important;
      flex-direction: row-reverse;
      justify-content: left;
    }

    th, td {
      padding: 8px;
      text-align: left;
      border-bottom: 1px solid var(--color-neutral-200);
    }

    td {
      text-align: left !important;
      width: auto !important;
      display: inline-block !important;

      .checkbox-mark {
        margin-top: -5px;;
      }
    }

    th {
      font-weight: 600;
    } 
  }

  .mini-button {
      padding: 2px 8px;
      font-size: 0.8em;
      margin-left: 10px;
  }

  
  .disabled {
      opacity: 0.5;
      cursor: not-allowed;
  }

  .add-category-form {
      margin-top: 20px;
      padding-top: 20px;
      border-top: 1px solid var(--color-border);
  }

  .add-category-form h4 {
      margin-top: 0;
  }

  .category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
  }

  .category-header span {
      font-size: 0.9em;
      color: var(--color-text-muted);
  }

  /*
  .checkbox-indicator {
    display: inline-block;
    color: var(--text-muted);
  }

  .checkbox-indicator.checked {
    color: var(--mid-blue);
    font-weight: bold;
  }
*/


  img.drag-handle {
    opacity: 0.5;
    width: 8px;
    height: auto;
    margin-right: 8px;
    vertical-align: baseline;
    
    &:hover {
      opacity: 1;
    }
  }
  
  span.drag-number {
    font-weight: 700;
    font-size: 14px;
  }
  
  table.category-visability-settings {
    
    margin-bottom: 20px;
    
    th, td {
      &.order-number {
        width: 10%;
        text-align: center;
      }
    }
    
    th, td {
      &.category {
        width: 50%;
      }
    }
    
    th, td {
      &.show-in-public-list {
        width: 20%;
      }
    }
    
    th, td {
      &.show-in-glass-list {
        width: 20%;
      }
    }
    
  }
    
  table.column-visability-settings {
    
    margin-bottom: 20px;
    
      th, td {
        &.order-number {
          width: 10%;
          text-align: center;
        }
      }
    
      th, td {
        &.column {
          width: 50%;
        }
      }
      
      th, td {
        &.display-name {
          width: 20%;
        }
      }
      
    th, td {
      &.show-in-list {
        width: 20%;
      }
    }
      
  }
}



/********** ADMIN EDIT FORM STYLING *********/

.edit-form {
	
	* {
		box-sizing: border-box;
	}
	
	display: none;
	background-color: var(--table-bg);
  
	
	&:hover {
		/* background-color: rgba(0,0,0,0.1); */
	}
	
	&.active { display: table-row; }
  
    .edit-header {
      display: flex;
      flex-direction: row;
      width: 100%;
      justify-content: space-between;
      margin-bottom: 30px;
      align-content: center;
    }
	
	.editWrapper {
		padding: 30px;
	}
	
	input {
		width: 100%;
	}
	
	td {
		padding: 40px;
        border: none !important;
	}
	
	h2 {
		margin-top: 0;
        margin-bottom: 0;
        color: var(--mid-blue);
	}
	
	i {
		font-weight: 400 !important;
    margin-top: 5px;
    display: block;
	}
  
  .sell-price {
    margin-top: 30px;
    
    label {
      margin-bottom: 5px;
    }
  }
	
  .glass-price {
    font-weight: 700;
    font-size: 18px;
        font-family: var(--font-data);
        color: var(--mid-blue);
  }
  
    .right-column {
      .button-group {
        margin-top: 30px;
      }
    }
}

/********** MESSAGES *********/

.message {
	padding: 20px 25px;
	border-radius: 4px;
	margin-bottom: 20px;
	opacity: 1;
	transition: opacity 0.5s ease-in-out;
	position: fixed;
	top: 20px;
	right: 45%;
	z-index: 1000;
  box-shadow: 0px 0px 25px rgba(0,0,0,0.3);

  &.success {
    background-color: var(--success-bg);
    border: 1px solid #c3e6cb;
    color: var(--success);
  }
  &.warning {
    background-color: var(--warning-bg);
    border: 1px solid var(--warning);
    color: var(--warning);
  }
  &.error {
    background-color: var(--critical-bg);
    border: 1px solid var(--critical);
    color: var(--critical);
  }
  &.hidden {
    opacity: 0;
  }

}

.out-of-stock {
	color: var(--critical);
}
.admin-link {
	text-align: right;
	margin-bottom: 20px;
}
.admin-link a {
	color: var(--dark-gray);
	text-decoration: none;
}
.admin-link a:hover {
	text-decoration: underline;
}

.unlisted {
  color: var(--gray);
}

/***** Modal styling ******/

.modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--modal-bg);
	z-index: 1001;
}

.modal {
    background-color: var(--content-bg-primary);
    color: var(--text-primary);
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	padding: 40px;
	border-radius: 5px;
	box-shadow: 0 2px 10px var(--separator-mid-gray);
	max-width: 900px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	z-index: 1001;
  
    @media (max-width: 540px) {
      top: 0;
      left: 0;
      transform: none;
      padding: 5%;
      width: 90%;
      height: 100vh;
    }
}

.modal-buttons {
  position: absolute;
  top: 20px;
  right: 20px;
}

.modal h2 {
	margin-top: 0;
	margin-bottom: 20px;
	color: var(--dark-blue);
}

#restoreModal {
  .modal {
    max-width: 500px;
    width: 50%;
  }
}

/******** Fact box *******/

.fact-box {
  margin: 3% 0;
  
  ul {
    padding: 10px 0;
    margin: 0;
    
    li {
      border-bottom: 1px dashed var(--separator-gray);
      
      &:first-child {
        border-top: 1px dashed var(--separator-gray);
      }
    }
  }
}


/***** Filters ****/

/* Filter Toggle Button and Responsive Filter Styles */

/* Show filter toggle button on mobile only */
.filter-toggle {
  display: none;
  margin-bottom: 15px;
  
  @media (max-width: 700px) {
    display: block !important;
  }
}

/* Responsive styles for filter section */
@media (max-width: 700px) {
  /* Hide filters by default on mobile */
  .filters {
    display: none;
    transition: all 0.3s ease;
  }
  
  /* When filters are visible */
  .filters.visible {
    display: block;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 0 0 20px 0;
  }
  
  /* Show the toggle button */
  .filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }
  
  /* Ensure the filter toggle button icon is properly styled */
  .filter-toggle .icon {
    margin-right: 5px;
    margin-left: 0;
  }
}

/*Filter section styling */

 .filters {
	margin: 20px 0;
	padding: 15px;
	background: var(--white);
	border-radius: 4px;
	position: sticky;
	top: 0px;
	
	.filterGroup {
		justify-content: space-between;
        align-content: center;
		
		@media (max-width: 700px) {
		  gap: 15px;
		}
		
	}
	
	.filterTools {
		gap: 15px;
		align-items: center;
	}
	
	.filterActions {
		align-content: center;
		justify-content: end;
		gap: 15px;
		
		@media (max-width: 700px) {
			justify-content: space-between;
			gap: 15px;
			width: 100%;
		}
    
    button {
      height: auto;
    }
	}
	
	.toggle-filters {
		display: flex;
		flex-direction: row;
		
		label {
			/* width: 60px; */
            width: max-content;
            margin-right: 20px;
            /* margin-bottom: 0; */
		}

	}
	
	form {
		display: flex;
		gap: 15px;
		align-items: center;
	}
	
	input {
		color: inherit;
		margin-bottom: 0;
		width: 60%;
		
		@media (max-width: 700px) {
			width: 100%;
		}
	} 
	
}

th.current {
	background-color: var(--light-gray);
}
.sort-arrow {
	display: inline-block;
	margin-left: 0px;
	padding-right: 5px;
	color: var(--gray);
}



/************* ADMIN – PAIRING PACKAGES ***********/

.package-settings {

  .card-wrapper {
    display: flex;
    /*grid-template-columns: repeat(3, 1fr); */
    gap: 2.5%;
  }

  .card {
        padding: 50px 50px 30px 50px !important;
        box-shadow: 0 3px 21px #ccc;
        /* transform: rotate(-2deg); */
        flex: 1;
        min-width: 200px;
        border-radius: 8px;
        text-align: center;

        /*
        &:nth-child(2n) {
          transform: rotate(2deg);
        }
          */

        p {
          text-align: left;
          margin-top: 20px;

          &.price {
            text-align: center;
            font-weight: bold;
            font-family: var(--font-heading);
            font-size: 18px;
          }
        }

        .button-group {
          justify-content: center;
          margin-top: 20px;;
        }
  }
  
  .package-overview {
    
    th {
    
      &.name {
        width: 35%;
      }

      &.description {
        width: 35%;
      }

      &.price {
        width: 15%;
      }

      &.actions {
        width: 15%;
      }
    }

    td {
    
      &.name {
        font-weight: 700;
        font-size: 16px;
      }

      &.description {
        padding: 20px 10px;
      }

      &.price {
        text-align: right;
        font-weight: 700;
      }

    }
  }

  .package-details {
    margin-top: 40px;
    width: 100%;

    th {
      &.category {
        width: 15%;
      }
  
      &.producer {
        width: 25%;
      }
  
      &.article {
        width: 45%;
      }
  
      &.year {
        width: 5%;
      }
  
      &.action {
        width: 10%;
      }
    }
  }
  
  .unlisted {
    display: inline-block;
  }
  
  .package {
    margin-top: 40px;
    padding: 0;
    /* background-color: rgba(255,255,255,0.5);
    border-radius: 4px; */
  }

  .package h2 {
    margin: 20px 0;
  }
  
  .package h3 {
    margin-top: 0;
  }
  
  .package .description {
    margin-bottom: 15px;
    font-size: 120%;
    width: 38%;
    line-height: 1.3;

    @media (max-width: 700px) {
      width: 100%;
    }
  }
  
  .package .price {
    font-weight: bold;
    margin-bottom: 20px;
    font-family: var(--font-heading);
    font-size: 22px;
  }
  
  .package h4 {
    margin-top: 20px;
    margin-bottom: 15px;
  }
  
  .package table {
    width: 100%;
    margin-bottom: 20px;
  }
  
  #searchResults {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;

    @media (max-width: 700px) {
      max-height: none;
    }
  }
  
  #wineSearch {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    box-sizing: border-box;
  }

}


/***************  D R A G   N   D R O P  ***************/

.sortable tr {
    cursor: move;
}
.sortable tr:hover {
    background-color: #f5f5f5;
}
.ui-sortable-helper {
    display: table;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.order-number {
    color: #666;
    font-size: 0.9em;
    text-align: center;
}

/************ I M P O R T *************/

body.import {
	.container {
		max-width: 800px; 
		/* margin: 0 auto; */
	}

  h4 {
    color: var(--mid-blue);
    font-size: 16px;
    margin-top: 0px;
    margin-bottom: 10px;
  }
	
	.form-group {
		/* margin-top: 50px; */
        margin-top: 0;
		margin-bottom: 15px;
	}
  
  form {
    display: flex;
    gap: 3px;
    flex-direction: column;
  }
  
  strong {
      display: inline-block;
      font-weight: 700;
      color: var(--gray);
  }

  ul {
    width: 100%;
    margin: 0;
  }
  
  li {
    max-width: none;
  }

  .info {

    margin: 30px 0 10px 0;
  
    div {
      margin-bottom: 30px;
    }
  
    pre {
      display: inline-block;
      font-size: 90%;
      margin-left: 10px;;
    }

  }
  
  .validation-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;

    tr {

      &.error {
        background-color: var(--critical-bg);
      }

      &.warning {
        background-color: var(--warning-bg);
      }
    }

    td {
      /* Dark mode? border: 1px solid #ddd; */
      padding: 8px;
    }

    th {
      /* Dark mode? background-color: #f2f2f2; */
      padding: 8px;
      text-align: left;
    }
  }
 
  .validation-summary {
      margin: 20px 0;
      padding: 15px;
      border-radius: 4px;

      &.error {
        background-color: var(--critical-bg);
        border: 1px solid var(--critical);
      }

      &.success {
        background-color: var(--success-bg);
        border: 1px solid var(--success);
      }
  }
  
  .force-import-option {
      margin: 20px 0;
      padding: 15px;
      background-color: var(--warning-bg);
      border: 1px solid var(--warning);
      border-radius: 4px;
  }
}


/*********** B A C K U P **************/

.backup-date {
  display: block;
  color: var(--dark-gray);
}

.backup-name {
  font-weight: 700;
  margin: 10px 0;
  display: block;
}

.backup-item {
  padding: 3% 0;
  border-top: 1px solid var(--separator-gray);
  
  .button-group {
    margin-bottom: 0;
  }
}


/************ DB IS EMPYT *********/

body.admin {
	.import, .no-results-message {
		display: flex;
		flex-direction: column;
		align-content: end;
		height: 70vh;
		gap: 12px;
		justify-content: center;
		align-items: center;
		
		.container {
			max-width: 800px; 
			margin: 0 auto;
			height: auto;
			background-color: var(--white);
			padding: 30px;
			border-radius: 10px;
			text-align: left;
		}
		
		.form-group {
			margin-top: 10px;
			margin-bottom: 15px;
		}
	}
}


/************ THEME TOGGLE *********/

.theme-toggle {
  /*
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  */
}

.theme-toggle button {
  background-color: var(--mid-blue);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.theme-toggle button:hover {
  background-color: var(--dark-blue);
  transform: scale(1.05);
}

.moon-icon {
  display: none;
}

[data-theme="dark"] .sun-icon {
  display: none;
}

[data-theme="dark"] .moon-icon {
  display: block;
}

@media (max-width: 700px) {
  .theme-toggle {
    top: 15px;
    right: 15px;
  }
  
  .theme-toggle button {
    width: 35px;
    height: 35px;
  }
}

/************ Tenant admin **********/

body.dashboard, body.reports, body.admin { 

  section + section {
    margin-top: 2rem;
  }
  
  h2 {
    margin-bottom: 20px;
    font-size: 28px;
  }
  
  .dashboard-stats {
      display: flex;
      flex-wrap: wrap;
      gap: 20px;
      margin-bottom: 30px;
  }
  
  .card {
      background: var(--card-bg);
      border-radius: 8px;
      padding: 20px;
      box-shadow: 0 2px 4px var(--card-shadow);
      flex: 1;
      min-width: 200px;
      text-align: center;
  }
  
  .card h3 {
      margin-top: 0;
      color: var(--mid-blue);
  }
  
  .stat-value {
      font-size: 36px;
      font-weight: bold;
      margin: 10px 0;
      color: var(--dark-blue);
  }
  
  .log-container {
      /* background: #f5f5f5; */
      border-radius: 8px;
      padding: 15px;
      margin-top: 20px;
      max-height: 300px;
      overflow-y: auto;
      font-family: monospace;
      white-space: pre-wrap;
      border: 1px dashed var(--gray);
  }
  
  .table-container {
      margin-top: 30px;
  }
  
  /* Analytics */
  
  .changes-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 8px;
      font-size: 0.9em;
  }
  
  .changes-table th, .changes-table td {
      padding: 4px 8px;
      border: 1px solid #ddd;
      text-align: left;
  }
  
  .changes-table th {
      background-color: #f5f5f5;
      font-weight: 500;
  }
  
  .activity-details {
      list-style-type: none;
      padding: 0;
      margin: 0;
  }
  
  .activity-details li {
      margin-bottom: 6px;
  }
  
}

/***** LOADER ******/

.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.loader-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loader-content {
  background-color: white;
  padding: 20px;
  border-radius: 5px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.loader-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color, #3498db);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin: 0 auto 15px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/************ TAB NAVIGATION *********/

.tabs-container {
  margin: 20px 0;
}

.tabs-navigation {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--separator-gray);
  margin-bottom: 3rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tabs-navigation::-webkit-scrollbar {
  height: 4px;
}

.tabs-navigation::-webkit-scrollbar-track {
  background: var(--separator-light-gray);
}

.tabs-navigation::-webkit-scrollbar-thumb {
  background: var(--mid-blue);
  border-radius: 2px;
}

.tab {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: normal;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  min-width: fit-content;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--separator-light-gray);
}

.tab.active {
  color: var(--dark-blue);
  border-bottom-color: var(--dark-blue);
  font-weight: bold;
  background: transparent;
}

.tab:focus {
  outline: 2px solid var(--mid-blue);
  outline-offset: -2px;
}

.tab:focus:not(:focus-visible) {
  outline: none;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease-in;
}

.tab-panel.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile responsive tabs */
@media (max-width: 768px) {
  .tabs-navigation {
    gap: 5px;
    padding-bottom: 5px;
  }

  .tab {
    padding: 10px 15px;
    font-size: 13px;
  }
}

/* Dark theme adjustments */
body[data-theme="dark"] .tab {
  color: var(--text-secondary);
}

body[data-theme="dark"] .tab:hover {
  color: var(--text-primary);
  background: var(--separator-light-gray);
}

body[data-theme="dark"] .tab.active {
  color: var(--dark-blue);
  border-bottom-color: var(--dark-blue);
}
