/* =========================================
   GLOBAL RESET & BASE STYLES
========================================= */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  /* Background Image Added */
  background: url('../images/backgr.png') no-repeat center center fixed;
  background-size: cover;
  color: #333;
  /* Flexbox configuration to center single elements like login */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

h1, h2 {
  text-align: center;
  color: #2c3e50;
  margin-top: 0;
  margin-bottom: 20px;
}

/* =========================================
   LOGIN BOX SPECIFIC STYLING
========================================= */
.login-box {
  background: rgba(255, 255, 255, 0.63);
  backdrop-filter: blur(10px); /* Glassmorphism effect */
  -webkit-backdrop-filter: blur(10px);
  padding: 30px;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.login-box form {
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.error {
  color: #d9534f;
  margin-top: 15px;
  font-weight: 500;
  font-size: 14px;
}

.link {
  margin-top: 15px;
}

.link a {
  color: #007BFF;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.link a:hover {
  text-decoration: underline;
}

/* =========================================
   GENERAL FORMS & INPUTS
========================================= */
/* Style for generic forms used on other pages */
body > form:not(.login-box form) {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 500px;
  margin: 0 auto 40px auto;
}

label {
  display: block;
  margin-top: 15px;
  font-weight: 600;
  text-align: left;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
textarea,
button {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
textarea:focus {
  border-color: #007BFF;
  outline: none;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
}

textarea {
  resize: vertical;
}

button {
  background-color: #007BFF;
  color: white;
  border: none;
  margin-top: 20px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #0056b3;
}

input[type="file"] {
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f9f9f9;
}

/* =========================================
   TOOL COMPONENTS & TABLES
========================================= */
#tool_info {
  margin-top: 20px;
  padding: 10px;
  background-color: rgba(254, 254, 254, 0.95);
  border: 1px solid #ddd;
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.suggestion {
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #f9f9f9;
  transition: background 0.3s ease;
  cursor: pointer;
}

.suggestion:hover {
  background: #e0e0e0;
}

.suggestion img {
  display: block;
  margin-top: 8px;
  max-width: 100px;
  border-radius: 4px;
}

#tool-list {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  overflow-x: auto; /* Makes table horizontally scrollable on mobile */
}

#tool-list table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px; /* Forces scrolling rather than squishing data on mobile */
}

#tool-list th, #tool-list td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

#tool-list th {
  background-color: #f0f0f0;
  font-weight: bold;
}

#tool-list img {
  max-width: 60px;
  border-radius: 4px;
}

#image_preview img {
  display: block;
  margin-top: 10px;
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* =========================================
   RESPONSIVE DESIGN (MOBILE VIEW)
========================================= */
@media (max-width: 600px) {
  body {
    padding: 15px;
  }

  .login-box, 
  body > form:not(.login-box form), 
  #tool-list {
    padding: 20px;
    border-radius: 8px;
  }

  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="email"],
  input[type="password"],
  textarea,
  button {
    padding: 10px;
  }

  #tool-list table, 
  #tool-list th, 
  #tool-list td {
    font-size: 14px;
    padding: 10px 8px;
  }
}