*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  height: 100%;
}

/* Main Upload Container */
.upload-container {
  max-width: 450px;
  margin: 0;
  padding: 30px;
  /* background-color: rgba(255, 255, 255, 0.2); */
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 1.1rem;
  text-align: center;
}

/* Drag-and-Drop Upload Box */
.upload-drag-box {
  width: 100%;
  height: 100px;
  margin-top: 20px;
  border: 2px dashed #1e3a8a;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s;
  background-color: #f9f9f9;
  text-align: center;
}

.upload-drag-box.dragover {
  border-color: #2563eb;
  background-color: #2563eb;
}

.upload-drag-box p {
  font-size: 18px;
  color: #2563eb;
}
.upload-container h1 {
  color: #fff; /* dark gray */
}

/* Form Elements */
input.upload-input[type="text"],
input.upload-input[type="file"],
button.upload-form-button {
  padding: 5px;
  margin: 5px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 95%;
  font-size: 18px;
}

.upload-form-button {
  background-color: #1e3a8a;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
}

.upload-form-button:hover {
  background-color: #2563eb;
}

.upload-drag-box input[type="file"] {
  display: none;
}

form {
  max-width: 250px;
  margin: auto;
}

label {
  display: block;
  margin-bottom: 4px;
  font-weight: bold;
  font-size: 16px;
  text-align: left;
  color: #f0f0f0;
}

/* ===================== Responsive Design ===================== */

/* Tablets and below */
@media (max-width: 768px) {
  .upload-container {
    padding: 20px;
    margin: 20px;
    font-size: 1rem;
  }

  input.upload-input[type="text"],
  input.upload-input[type="file"],
  button.upload-form-button {
    width: 100%;
    font-size: 16px;
  }

  form {
    max-width: 100%;
    padding: 0 10px;
  }

  .upload-drag-box {
    height: 120px;
    font-size: 16px;
  }

  .upload-drag-box p {
    font-size: 16px;
  }

  label {
    font-size: 15px;
  }
}

/* Phones and small devices */
@media (max-width: 480px) {
  .upload-container {
    padding: 15px;
  }

  .upload-drag-box {
    height: 100px;
  }

  .upload-drag-box p {
    font-size: 14px;
  }

  input.upload-input[type="text"],
  button.upload-form-button {
    font-size: 14px;
  }

  label {
    font-size: 14px;
  }
}








/* Layout-specific styles for base.html */


body.upload-bg {
    background-image: url("/static/images/home3.png"); /* Update filename if needed */
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-color: transparent; /* override f5f5f5 */
}

.layout-navbar {
    background-color: #333;  
    padding: 1rem 0;
}

.layout-nav-container {
    width: 100vw;            /* full viewport width */
    padding: 0 20px;         /* padding on left & right */
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    max-width: none;         /* remove max-width */
    margin: 0;               /* remove auto centering */
    box-sizing: border-box;  /* ensure padding is included */
}

/* Move logo fully left (remove negative margin) */
.layout-nav-logo {
    margin-left: 0; /* reset negative margin */
}

/* Logo size */
.layout-nav-logo img {
    height: 70px; /* bigger logo size, adjust as needed */
    width: auto;
}

/* Nav links in center */
.layout-nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 0;
    margin: 0;
    flex-grow: 1; /* take remaining space */
}


.layout-nav-links li a {
  color: white;
  text-decoration: none;
  font-size: 1rem;
  padding: 8px 16px;               /* ➕ add padding like a button */
  border-radius: 5px;              /* ➕ smooth corners */
  transition: background-color 0.3s ease, color 0.3s ease;
}

.layout-nav-links li a:hover {
  background-color: white;         /* ➕ white bg */
  color: #0056b3;                  /* ➕ blue text (like login button) */
}

/* Hide menu button by default (desktop) */
.layout-nav-toggle {
    display: none;
}

.layout-login-desktop {
  display: flex;              /* Arrange items horizontally */
  align-items: center;        /* Align vertically */
  gap: 12px;                  /* Add spacing between items */
  padding-right: 20px;
  color: #fff;
}

.layout-login-button {
    background-color:#0056b3; /* Darker blue on hover */
     
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.layout-login-button:hover {
    background-color: #007bff; /* Bright blue */
    color: white;
 
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .layout-nav-container {
        padding: 0 20px;
        justify-content: space-between;
    }

    .layout-nav-links {
        display: none;
    }

    /* .layout-nav-links.layout-show {
        display: flex;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background-color: #333;
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        gap: 1rem;
        z-index: 1000;
    } */
    .layout-nav-links.layout-show {
      display: flex;
      position: absolute;
      top: 60px;
      right: 0px;
      background-color: #333;
      flex-direction: column;
      align-items: flex-start;
      padding: 1rem;
      gap: 0.5rem;
      z-index: 1000;
      width: max-content;        /* width adjusts to content */
      max-width: 90vw;           /* prevent overflow */
      height: auto;              /* height adjusts to content */
      /* border-radius: 8px; */
      box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    }
    .layout-nav-links.layout-show li a:hover {
      background-color: #fff;
      color: #0056b3;
    }
    
    .layout-nav-links.layout-show li a {
      width: 100%;
      padding: 10px 14px;
      color: white;
      text-decoration: none;
      font-size: 1rem;
      border-radius: 5px;
      transition: background-color 0.3s ease, color 0.3s ease;
    }
    
   


    /* Show toggle only on small screens and align it right with padding */
    .layout-nav-toggle {
        display: block;
        font-size: 1.8rem;
        color: #fff;
        background: none;
        border: none;
        cursor: pointer;
        position: absolute;
        right: 20px; /* match padding */
        top: 50%;
        transform: translateY(-50%);
    }

    .layout-login-desktop {
        display: none;
    }

    .layout-mobile-only {
        display: block;
    }

    .layout-nav-logo img {
        height: 40px; /* smaller logo */
    }

    .layout-nav-logo {
        margin-left: 0; /* reset left margin */
    }
}

/* On desktop, hide the mobile-only menu item */
@media (min-width: 769px) {
    .layout-mobile-only {
        display: none;
    }
}





.upload-bg {
    background-image: url('/static/images/home3.png'); /* Adjust path if needed */
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed; /* Optional: keeps background fixed during scroll */
}




/* Result */


.results-page-container {
  max-width: 1000px;
  margin: auto;
  padding: 2rem;
  font-family: 'Segoe UI', sans-serif;
  color: #222;
  background-color: #f9f9f9;
  box-sizing: border-box;
}

.results-title {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  color: #1e3a8a;
}

.results-subtitle {
  margin-top: 2rem;
  font-size: 1.5rem;
  color: #2563eb;
}

.results-section {
  margin-bottom: 2rem;
}

.results-img {
  width: 100%;
  max-width: 800px;
  height: auto;
  display: block;
  margin: 1rem auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.table-wrapper {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.results-table th,
.results-table td {
  border: 1px solid #ccc;
  padding: 12px;
  text-align: left;
  font-size: 0.95rem;
}

.results-table th {
  background-color: #eff6ff;
  color: #1e3a8a;
}

.export-btn,
.back-btn {
  display: inline-block;
  margin-right: 1rem;
  margin-top: 1rem;
  padding: 10px 20px;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.export-btn:hover,
.back-btn:hover {
  background-color: #1e40af;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .results-title {
    font-size: 1.7rem;
  }

  .results-subtitle {
    font-size: 1.2rem;
  }

  .results-img {
    max-width: 100%;
  }

  .export-btn,
  .back-btn {
    width: 100%;
    margin-bottom: 1rem;
  }

  .results-table th,
  .results-table td {
    font-size: 0.85rem;
  }
}


  

/* Footer css */


.site-footer {
    background-color: #222;
    color: #eee;
    padding: 2rem 1rem;
    font-size: 14px;   
  }
  
  .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
  }
  
  .footer-message {
    margin-bottom: 1rem;
    font-size: 16px;
  }
  
  .footer-links {
    margin-bottom: 1rem;
  }
  
  .footer-links a {
    color: #ccc;
    margin: 0 15px;
    text-decoration: none;
  }
  
  .footer-links a:hover {
    color: #fff;
  }
  
  .footer-social {
    margin-bottom: 1rem;
  }
  
  .footer-social a img {
    width: 24px;
    margin: 0 10px;
    vertical-align: middle;
    filter: brightness(0) invert(1);
  }
  
  .footer-copy {
    font-size: 13px;
    color: #aaa;
  }
  
  .footer-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
  }
  
  .footer-social img {
    width: 24px;
    height: 24px;
    filter: invert(1); /* Optional: makes black icons white on dark backgrounds */
    transition: transform 0.3s ease;
  }
  
  .footer-social a:hover img {
    transform: scale(1.2);
  }


  /* Sticky footer layout fix */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* .main-content {
    flex: 1;
} */
  
.main-content {
    flex: 1; /* fill remaining height */
    display: flex;
    justify-content: center;
    align-items: center;
    
}






  /* Home page */

  /* .home-background {
    background-image: url('/static/images/toolcutting1.jpg'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  } */

  
  .home-background {
    position: relative;
    width: 100vw;
    /* height: 100vh;
    min-height: 100vh;  */
    min-height: 100vh;
    background-image: url('/static/images/toolcutting1.jpg'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* z-index: -1; */
  }
  
  .home-page-container {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 800px;
  }

.home-welcome-box {
  background: #f8fafc;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.home-guest {
  background: #e0f2fe;
}

.home-welcome-heading {
  font-size: 2rem;
  margin-bottom: 15px;
  color: #1e293b;
}

.home-welcome-subtext {
  font-size: 1.1rem;
  color: #475569;
  margin-bottom: 25px;
}

.home-logout-button,
.home-login-cta-button {
  padding: 12px 24px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background-color: #2563eb;
  color: white;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

.home-logout-button:hover,
.home-login-cta-button:hover {
  background-color: #1e40af;
}








/*  login page */


.flash-popup {
  position: fixed;
  top: 20px; /* Distance from top */
  left: 50%;
  transform: translateX(-50%);
  background-color: #444;
  color: #fff;
  padding: 16px 28px;
  font-size: 1.1rem;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  transition: opacity 0.4s ease;
  max-width: 90%;
  text-align: center;
}

.flash-popup.success {
  background-color: #28a745;
}

.flash-popup.error {
  background-color: #dc3545;
}



/* ===== Modal Overlay ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.modal-overlay.show {
    display: block;
}

/* ===== Login Modal Container ===== */
.login-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
  max-width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding: 20px;
    overflow-y: auto; /* Allow scroll if content taller than viewport */
}

.login-modal.show {
    display: flex;
}

/* ===== Login Container ===== */
.login-container {
    position: relative;
    background-image: url('/static/images/toolcutting.jpg'); /* your image path */
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    padding: 40px 30px;
    max-width: 400px;
    width: 100%;
    color: white;
    box-shadow: 0 0 15px 3px #38bdf8;
    animation: pulseGlow 3s infinite alternate;
    overflow: hidden;
    z-index: 1;
    box-sizing: border-box;
}

/* Optional overlay for better text readability */
.login-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5); /* semi-transparent dark overlay */
    border-radius: 12px;
    z-index: -1;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px 2px #2563eb;
    }
    100% {
        box-shadow: 0 0 30px 10px #38bdf8;
    }
}

/* ===== Close Button ===== */
.modal-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: white;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
}

/* ===== Swap Panel Wrapper ===== */
.login-register-wrapper {
    width: 100%;
    overflow: hidden;
}

/* Container holding login/register forms */
.form-container {
    display: flex;
    width: 200%;
    transition: transform 0.5s ease-in-out;
    transform: translateX(0%);
}

/* Active state slides to register form */
.form-container.active {
    transform: translateX(-50%);
}

.form-panel {
    width: 50%;
    padding: 0 10px;
    box-sizing: border-box;
}

/* ===== Headings ===== */
.form-panel h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #38bdf8;
}

/* ===== Inputs ===== */
.login-input {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 16px;
    box-sizing: border-box;
    border: 1px solid #333;
    border-radius: 6px;
    background-color: #222;
    color: #eee;
}

.login-input::placeholder {
    color: #aaa;
    font-size: 15px;
}

/* ===== Button ===== */
.login-button {
    width: 100%;
    padding: 12px;
    background-color: #2563eb;
    color: white;
    border: none;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-button:hover {
    background-color: #1e40af;
}

/* ===== Toggle Form Message ===== */
.toggle-message {
    text-align: center;
    color: #aaa;
    font-size: 14px;
    margin-top: 10px;
}

.toggle-message span {
    color: #38bdf8;
    cursor: pointer;
    font-weight: 500;
}

/* ===== Responsive Design ===== */

/* Small screens (mobile) */
@media screen and (max-width: 500px) {

    .login-modal {
        padding: 15px;
        align-items: flex-start; /* Start at top so it scrolls nicely */
        overflow-y: auto;
    }

    .login-container {
        max-width: 100%;
        padding: 30px 20px;
        border-radius: 8px;
        box-shadow: 0 0 10px 2px #38bdf8;
    }

    /* Stack forms vertically */
    .form-container {
        display: block;
        width: 100%;
        transform: translateX(0%) !important;
    }

    .form-container.active {
        transform: translateX(0%) !important;
    }

    .form-panel {
        width: 100%;
        padding: 0;
        margin-bottom: 30px;
    }

    .modal-close-button {
        top: 8px;
        right: 10px;
        font-size: 20px;
    }
}

/* Medium screens (tablets) */
/* ===== Mobile Responsive Fix ===== */
@media screen and (max-width: 500px) {
    .login-modal {
      padding: 10px;
      align-items: flex-start;
      align-items: center; /* ✅ center vertically */
      justify-content: center; /* ✅ center horizontally */
    }
  
    .login-container {
      width: 100%;
      max-width: 100%;
      height: auto;
      border-radius: 8px;
      padding: 20px 15px;
      margin-top: 40px;
      box-shadow: 0 0 12px 2px #38bdf8;
    }
  
    .form-container {
      display: block;
      width: 100%;
      transform: translateX(0%) !important;
    }
  
    .form-panel {
      display: none;
      width: 100%;
      padding: 0;
    }
  
    .form-container:not(.active) .form-login {
      display: block;
    }
  
    .form-container.active .form-register {
      display: block;
    }
  
    .login-input {
      font-size: 14px;
      padding: 10px;
    }
  
    .login-button {
      font-size: 14px;
      padding: 10px;
    }
  
    .modal-close-button {
      font-size: 20px;
      top: 10px;
      right: 15px;
    }
  
    .form-panel h2 {
      font-size: 20px;
    }
  }



  .login-error {
    color: red;
    display: none;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
  }
  




  





  







/* Table */

.table-container {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  flex: 1;
  /* max-width: 50%; */
  max-width: 400px;
  margin-right: 50px;
}

.table-container h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 18px;
  color: #333;
}

.table-container table {
  /* width: 25%; */
  max-width: 300px;
  border-collapse: collapse;
  font-size: 13px; /* Smaller font for compact data */
}

.table-container th,
.table-container td {
  padding: 6px 10px; /* Reduced padding */
  border: 1px solid #ccc;
  text-align: center;
}

.table-container th {
  background-color: #4CAF50;
  color: white;
  font-size: 13px;
}

.table-container tr:nth-child(even) {
  background-color: #f9f9f9;
}

.table-container th:first-child,
.table-container td:first-child {
  min-width: 150px; /* Size column */
}

.table-container th:last-child,
.table-container td:last-child {
  min-width: 180px; /* Quantity column */
}

@media (max-width: 600px) {
  .table-container {
    max-width: 100%;
    margin-right: 0;
    padding: 12px;
  }

  .table-container h2 {
    font-size: 16px;
  }

  .table-container table {
    font-size: 12px;
    min-width: 100%; /* Ensure it scrolls if content is wide */
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .table-container th,
  .table-container td {
    padding: 6px 8px;
  }

  .table-container th:first-child,
  .table-container td:first-child,
  .table-container th:last-child,
  .table-container td:last-child {
    min-width: auto;
  }
}
