/* ----------------- Global & Body ----------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background: linear-gradient(135deg, #eef1f7, #c3cfe2);
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ----------------- Header ----------------- */
header {
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.8);
  width: 100%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2rem;
  color: #007BFF;
}

header p {
  font-size: 1rem;
  color: #666;
}

/* ----------------- Navigation ----------------- */
nav {
  width: 100%;
  background: #0056b3;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

nav a {
  color: #fff;
  margin: 5px 15px;
  font-size: 16px;
  text-decoration: none;
  transition: background 0.3s;
  padding: 10px 15px;
}

nav a:hover {
  background: #00408a;
  border-radius: 5px;
}

/* ----------------- Container & Main ----------------- */
.container, main {
  width: 90%;
  max-width: 1200px;
  margin: 20px auto;
}

/* ----------------- Search Bar ----------------- */
.search-bar {
  width: 90%;
  max-width: 600px;
  margin: 20px auto;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 25px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 10px 20px;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  padding: 10px;
}

.search-bar button {
  background: #007BFF;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.search-bar button:hover {
  background: #0056b3;
}

/* ----------------- Tools Grid & Cards ----------------- */
.cards-grid, .tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.card, .tool-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  min-height: 220px; /* smaller than before */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card:hover, .tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

/* Icon Box for cards */
.icon-box {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  background: #e9ecef;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

/* Card Title & Description */
.card h2, .tool-card h2 {
  font-size: 1.2rem;
  color: #007BFF;
  margin-bottom: 10px;
}

.card p, .tool-card p {
  font-size: 0.9rem;
  color: #666;
}

/* ----------------- Ribbon (if needed) ----------------- */
.ribbon {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, #007BFF, #0056b3);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
}

/* ----------------- Tool Page Layout ----------------- */
.tool-page {
  width: 100%;
  max-width: 700px;
  margin: 20px auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tool-page .header {
  background: linear-gradient(135deg, #007BFF, #0056b3);
  color: #fff;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-page .header i {
  margin-right: 10px;
}

.tool-page .header h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.tool-page .content {
  padding: 20px;
}

/* Ensure instructions are left aligned */
.tool-page .content ul {
  text-align: left;
  margin: 0 auto;
  max-width: 500px;
}

.tool-page .content input,
.tool-page .content select,
.tool-page .content textarea {
  width: 100%;
  max-width: 500px;
  margin: 10px auto;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
}

.tool-page .content button {
  width: 100%;
  max-width: 200px;
  margin: 10px auto;
  padding: 10px;
  border: none;
  border-radius: 5px;
  background: #007BFF;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

.tool-page .content button:hover {
  background: #0056b3;
}

/* Themed Reset & Download Buttons */
.btn-reset {
  background: #ffb64d !important;
  margin-right: 5px;
}

.btn-download {
  background: #28a745 !important;
  margin-left: 5px;
}

/* ----------------- Result Box ----------------- */
.result {
  margin-top: 15px;
  padding: 15px;
  background: #f5f7fa;
  border-radius: 5px;
  border: 1px solid #ddd;
  font-size: 0.95rem;
  text-align: left;
}

/* ----------------- Footer ----------------- */
footer {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.8);
  width: 100%;
  text-align: center;
  padding: 15px;
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
  color: #666;
}

.hidden {
  display: none;
}

/* ----------------- Copy to Clipboard Button ----------------- */
.btn-copy {
  background: #6c757d !important;
  margin-left: 5px;
}

.btn-copy:hover {
  background: #5a6268 !important;
}