* {
  margin: 0;
  padding: 0;
  box-sizing: border-box; 
}


body {
    display: flex;
    height: 100vh;
    font-family: Arial, sans-serif;
    overflow: hidden; 
}

.main-layout {
    display: flex;
    width: 100%;
    flex-direction: column;
    margin-left: 5rem; /* matches collapsed sidebar width */
    width: calc(100% - 5rem);
}

.sidebar.sb-expanded ~ .main-layout {
    margin-left: 13rem;
    width: calc(100% - 13rem);
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.sidebar.sb-expanded{
  width: 13rem;
}

.sb-expanded .nav-text{
  opacity: 1;
  visibility: visible;
}

.sb-expanded #nav-last i{
  rotate: 180deg;
}


.side-icon {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    color: white;
}

.side-icon i {
  margin-top: 1rem;
}

.sidebar:not(.sb-expanded) .logo-full { display: none; }
.sidebar:not(.sb-expanded) .side-icon i { margin-left: 0.5rem; }

.sidebar{
  background-image: linear-gradient(180deg, rgb(31, 41, 55) 0%, rgb(55, 65, 81) 100%);
  display: flex;
  flex-direction: column;
  gap: 4rem;
  position: fixed;
  inset: 0 auto 0 0;
  width: 5rem;
  transition: width 0.5s ease-in-out;
    
}

.sidebar h1{
  color: whitesmoke;
  font-size: 1.5rem;
  padding: 0 1rem;
  margin-top: 2rem;
}

.navbar{
  flex: 1;
  display: flex;
  flex-direction: column;
}

.navbar ul{
  list-style: none;
  display: flex;
  flex-flow: column;
  gap: 0.25rem;
  height: 100%;
  flex: 1;
}


.nav-text{
  opacity: 0;
  visibility: none;
  transition: opacity 0.3s ease-in-out, vusibility 0.3s ease-in-out

}

.navbar li {
  list-style: none;
  transition: background-color 0.3s ease;
  gap: 1rem;
}

ul li:last-child{
  margin-top: auto;
}

.navbar li a i, .navbar li form i{
  margin-left: 0.5rem;
}


.navbar li a{
  
  display: flex;   
  padding: 1rem;       
  align-items: center;       
  width: 100%;
  gap: 0.625rem;                
  color: whitesmoke;
  text-decoration: none;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.nav-form{
  padding:1rem ;
}

#nav-last{
  padding: 1rem; 
  transition: background-color 0.3s ease;
}

#nav-last i{
  margin-left: 0.5rem;
}

#nav-last:hover{
    background-color: rgba(255, 255, 255, 0.15);
  border-radius: 4px; 
}


.nav-form {
  margin: 0;
  width: 100%;
}

.nav-button {
  all: unset;           
  display: flex;
  width: 100%;
  align-items: center;
  color: whitesmoke;
  font-size: 1rem;
  cursor: pointer;
  gap: 0.625rem;
}

.navbar li a:hover, .navbar li form:hover{
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 4px; 
}


.navbar li.active a {
  border-left: 4px solid rgb(84, 84, 235);
  background-color: rgba(17, 24, 39);
}


.navbar i {
  margin-right: 0rem; /* move spacing inside the clickable area */
}






.main-content{
  overflow-y: auto; /* Enable vertical scrolling */
  overflow-x: hidden; /* Hide horizontal scroll */
}

.topbar{
  background-color: white;
  width: 100%;
  padding: 1.5rem;
  border-bottom: 1px solid rgb(204, 201, 201);
  display: flex;
}

.search-container {
  --padding: 10px; /* variable to maintain same px size */

  width: max-content; /* Width of container will be determiend by the conent within in it*/
  display: flex;
  align-items: center;
  padding: var(--padding);
  border-radius: 14px;
  background: #fae3e3;
  width: 600px;

}

.search-container-hidden{
  visibility: hidden;
}

.search-container input {
  font-size: 16px;
  color: #333333;
  margin-left: var(--padding);
  outline: none;
  border: none;
  background: transparent;
  flex: 1;

}

.main-content{
  background-color: rgba(243, 244, 246);
  height: 100%;
}

.product-stats{
  margin-top: 2rem;
  display: flex;
  justify-content: space-evenly;
  flex-wrap: wrap;

}

.stat{
  display: flex;
  gap: 5rem;
  padding: 1rem;
  border-radius: 12px;
  background-color: white;
  box-shadow: 1px 1px #888888;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stat-info p{
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  color: #b77b7b
}

.stat i{
  align-self: center;
  color: rgb(131, 67, 235);
  font-size: 2rem;
  background-color: rgba(219, 234, 254);
  padding: 1rem;
  border-radius: 12px;
}

.stat:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.recent-products{
  margin-top: 2rem;
  margin-left: 2rem;
  margin-right: 2rem;
  background-color: white;
  border-radius: 12px;
  box-shadow: 1px 1px #888888;
}

caption{
  text-align: start;
  margin-left: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}
caption h2{
  font-size: 1.2rem;
}



/******************TABLE styles**************/

.recent-products table {
  width: 100%;
  border-collapse: collapse; /* Remove double borders */
  font-size: 0.9rem;

}

.recent-products table th,
.recent-products table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb; 
}

.recent-products table thead {
  border-bottom: #888888;
}

.recent-products table thead th {
  color: #374151; 
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recent-products table tbody tr:hover {
  background-color: #bebebe; 
  transition: background-color 0.2s ease-in-out;
}

.recent-products table tbody td {
  color: #4b5563; 
}

.instock, .lowstock, .nomore{
  padding: 0.5rem;
  border-radius: 12px;
  text-align: center;
}

.instock{
  color: green;
  background-color: gainsboro;
}

.lowstock{
  color: rgb(209, 66, 66);
  background-color: rgb(233, 233, 108);
}

.nomore{
  color: rgb(255, 0, 0);
  background-color: pink;
}





/*********************Products Page************************/

.add-product{
  display: flex;
  margin-right: 5rem;
  margin-left: auto;
  padding: 1rem;
  background-color: blue;
  width: max-content;
  gap: 0.5rem;
  border-radius: 12px;
  cursor: pointer;
  align-items: center;

  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.add-product:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.add-product a{
  outline: none;
  border: none;
  text-decoration: none;
  background: none;
  color: whitesmoke;
  cursor: pointer;
  font-size: 1rem;
}

.add-product i {
  color: white;
  cursor: pointer;
}

.products{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Responsive grid */
  gap: 2rem;
  margin: 1rem;
  padding: 1rem;
}

.product{
  display: flex;
  flex-direction: column;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem;
  background-color: white;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
}

.prod-row{
  margin-top: auto;
  display: flex;
  justify-content: space-between;
}

.prod-row a{
  text-decoration: none;
  background-color: rgba(0, 0, 255);
  padding: 12px;
  color: white;
  border-radius: 12px;
}

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

.product img{
  width: 100%;
  height: 150px; /* Fixed height for uniformity */
  object-fit: cover; /* Maintains aspect ratio, crops overflow */
  margin-bottom: 1rem;
}

.product h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.product h3 {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.qty{
  margin-top: auto;
}


/*=======================CREATE PRODUCT==================*/

.add-h1{
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  color: #1f2937;
  font-size: 1.75rem;
}

.product-form{
  max-width: 900px;
  margin: 0 auto 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0 1.5rem;
}

.form-section{
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.form-layout{
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  flex: 1;
  min-width: 300px;
  max-width: 400px;
}

.form-layout label{
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.form-layout input{
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: gainsboro;
}

.form-layout input:focus{
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-layout input:hover{
  border-color: #d1d5db;
}

.form-btns{
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.cancel-btn, .submit-btn, .delete-btn{
  padding: 0.85rem 2.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
}

.cancel-btn{
  background-color: #ef4444;
  color: white;
}

.cancel-btn:hover{
  background-color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.submit-btn{
  background-color: #22c55e;
  color: white;
}

.submit-btn:hover{
  background-color: #16a34a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.delete-btn{
  background-color: #c52222;
  color: white;
}

.delete-btn:hover{
  background-color: #16a34a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.error{
  color: #dc2626;
  font-size: small;
}


.error-404{
  text-align: center;
  margin-top: 10rem;
  text-decoration: underline;
}


/**********Reports********/

.rpt-case{
  display: flex;
  gap:7rem;
  justify-content: center;
  margin-top: 10rem;
  flex-wrap: wrap;
  padding: 1rem;
}

.excel, .pdf{
  text-align: center;
  background-color: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 2px 2px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.excel:hover, .pdf:hover{
  background-color: #16a34a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.excel i, .pdf i{
  font-size: 10rem;
}

.excel p, .pdf p{
  margin-top: 1rem;
  font-weight: 600;
}


/************************Login****************************/

.login-page{
  width: 100%;
  height: 100vh;
  background-color: rgba(31, 41, 55);
  display: flex;
  flex-direction: column;
  justify-content:center ;
  align-items: center;
}

.h2-span{
  color: #50e942;
}

.login-content{
  border-top: 1px solid grey;
  border-bottom: 1px solid grey;
  padding-top: 2rem;
  padding-bottom: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  width: 50vw;
}

.login-title{
  color: whitesmoke;
}

.auth-form{
  display: flex;
  gap: 2rem;
  flex-direction: column;
}

/* Error styling!!!*/
.auth-form p{
  color: #f73636;
  font-size: 10px;
  margin-top: -20px;
  margin-bottom: -20px;
}

.email, .password{
  --padding: 0px;
  --border-radius: 7px;
  width: max-content;
  display: flex;
  align-items: center;
  padding: var(--padding);
  width: 250px;
  background: #fae3e3;
  border-radius: var(--border-radius);
  border: 0.1px solid transparent; 
  transition: all 0.3s ease-in-out;
}

.email input, .password input{
  outline: none;
  border: none;
  background: transparent;
  flex: 1;
  margin-left: 1rem;

}

.email:hover, .password:hover{
  border-color: #3b82f6; 
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.email i{
  background-color: #16a34a;
  padding: 0.6rem 1rem;
  color: white;
  border-radius: var(--border-radius);
}

.password i{
  background-color: #ffb848;
  padding: 0.6rem 1rem;
  color: white;
  border-radius: var(--border-radius);
}

.auth-form button{
  padding: 0.5rem;
  border-radius: 10px;
  border: none;
  font-size: medium;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

.auth-form button:hover {
  transform: scale(1.05);
  background-color: #16a34a;
  color: white;
  cursor: pointer;
}





@media (max-width: 1200px) {

  .recent-products {
    overflow-x: auto;
  }
  .recent-products table {
    min-width: 600px;
  }
  /* Stats */
  .product-stats {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
  }

  .stat {
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
  }

}

/* Responsive */
@media (max-width: 768px) {

  .form-layout{
    min-width: 100%;
  }
  
  .form-btns{
    flex-direction: column;
    gap: 1rem;
  }
  
  .cancel-btn, .submit-btn, .delete-btn{
    width: 100%;
  }


  /* Stats */
  .product-stats {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
  }

  .stat {
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
  }

  /* Table */
  .recent-products {
    margin: 1rem;
    overflow-x: auto;
  }

  .recent-products table {
    min-width: 500px;
  }


}

