/* ========================================
   BENIX TOOLS - MODERN BOOTSTRAP STYLES
   ======================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #dbeafe;
  --primary-color: #2563eb;
  --secondary: #7c3aed;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  --dark: #0f172a;
  --light: #e2e8f0;
  --muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-color: #e2e8f0;
  --bg-light: #f8fafc;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #fff;
  color: var(--dark);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
}

/* ========================================
   NAVBAR STYLES
   ======================================== */

.navbar {
  padding: 1rem 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.3s ease;
}

.navbar:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

.navbar-brand {
  font-size: 1.5rem;
  color: var(--primary) !important;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.navbar-brand:hover {
  color: var(--primary-dark) !important;
}

.nav-link {
  font-weight: 500;
  color: var(--dark) !important;
  margin: 0 0.5rem;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--primary) !important;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  text-align: center;
  padding: 6rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-30px); }
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
  position: relative;
  z-index: 1;
  animation: slideDown 0.6s ease-out;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  animation: slideDown 0.6s ease-out 0.2s both;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

/* ========================================
   MAIN CONTENT
   ======================================== */

main {
  min-height: calc(100vh - 64px - 400px);
  padding: 3rem 0;
}

.container-lg {
  max-width: 1300px;
}

/* ========================================
   TOOL CARDS
   ======================================== */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.tool-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.tool-card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-8px);
  border-color: var(--primary);
}

.tool-card:hover::before {
  transform: scaleX(1);
}

.tool-card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.tool-card h3 {
  color: var(--dark);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.tool-card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.tool-card .badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ========================================
   TOOL PAGE STYLES
   ======================================== */

.tool-header {
  background: linear-gradient(135deg, var(--primary-light) 0%, #ede9fe 100%);
  padding: 3rem 2rem;
  border-radius: 12px;
  margin-bottom: 2.5rem;
  border-left: 5px solid var(--primary);
}

.tool-header h1 {
  color: var(--dark);
  margin-bottom: 0.5rem;
  font-size: 2rem;
}

.tool-header p {
  color: var(--muted);
  font-size: 1.05rem;
}

.tool-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.tool-main {
  display: flex;
  flex-direction: column;
}

.tool-sidebar {
  background: linear-gradient(135deg, var(--bg-light) 0%, #f1f5f9 100%);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  height: fit-content;
  position: sticky;
  top: 100px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.tool-sidebar h3 {
  color: var(--dark);
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 600;
  color: var(--dark);
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background-color: white;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="file"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background-color: white;
}

textarea {
  resize: vertical;
  min-height: 140px;
}

::placeholder {
  color: var(--muted);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  padding: 0.85rem 1.75rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  letter-spacing: 0.3px;
  border: 2px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
  color: white;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background-color: var(--bg-light);
  color: var(--primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background-color: var(--light);
  border-color: var(--primary);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

.btn-outline-primary {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: white;
}

.btn-outline-primary:hover {
  background: var(--primary-light);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   UPLOAD AREA
   ======================================== */

.upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.02) 0%, rgba(124, 58, 237, 0.02) 100%);
}

.upload-area:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
  transform: scale(1.02);
}

.upload-area.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
}

.upload-area-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.upload-area p {
  color: var(--muted);
  margin: 0;
  font-weight: 500;
}

.upload-area .small {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: block;
}

/* ========================================
   RESULT DISPLAY
   ======================================== */

.result-box {
  background: linear-gradient(135deg, var(--bg-light) 0%, #f1f5f9 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  border-left: 5px solid var(--success);
}

.result-box h4 {
  color: var(--dark);
  margin-bottom: 1rem;
}

.result-content {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  word-break: break-all;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--dark);
  max-height: 300px;
  overflow-y: auto;
}

.copy-btn {
  margin-top: 1rem;
}

/* ========================================
   ALERTS & MESSAGES
   ======================================== */

.alert {
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 5px solid;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-left-color: var(--success);
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border-left-color: var(--danger);
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border-left-color: var(--warning);
}

.alert-info {
  background: #dbeafe;
  color: #0c4a6e;
  border-left-color: var(--info);
}

/* ========================================
   MODALS & DIALOGS
   ======================================== */

.modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.modal-header {
  border-bottom: 2px solid var(--border);
  padding: 2rem;
}

.modal-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  border-top: 2px solid var(--border);
  padding: 2rem;
}

/* ========================================
   COUNTDOWN & ANIMATIONS
   ======================================== */

.countdown-timer {
  font-size: 5.5rem;
  font-weight: 800;
  color: var(--primary);
  margin: 1.5rem 0;
  line-height: 1;
  animation: pulse 1s infinite;
  text-shadow: 0 2px 10px rgba(37, 99, 235, 0.1);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.05);
  }
}

.ad-container {
  background: linear-gradient(135deg, var(--bg-light) 0%, #f0f4f8 100%);
  padding: 2rem 1.5rem;
  border-radius: 12px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
  border: 2px dashed var(--border);
  flex-direction: column;
  transition: all 0.3s ease;
  background-color: #fafbfc;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
  background: linear-gradient(135deg, var(--dark) 0%, #1e293b 100%);
  color: white;
  margin-top: 5rem;
  padding-top: 3rem;
}

footer h5 {
  color: white;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

footer a {
  color: #cbd5e1;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

footer a:hover {
  color: var(--primary);
  transform: translateX(3px);
}

.text-light-60 {
  color: rgba(255, 255, 255, 0.7);
}

footer .text-light-60:hover {
  color: white;
}

.social-links .btn {
  margin: 0 0.5rem;
}

footer hr {
  opacity: 0.2;
}

/* ========================================
   BADGES & PILLS
   ======================================== */

.badge {
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 20px;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-success {
  background: #d1fae5;
  color: var(--success);
}

.badge-danger {
  background: #fee2e2;
  color: var(--danger);
}

.badge-warning {
  background: #fef3c7;
  color: var(--warning);
}

/* ========================================
   TABLES
   ======================================== */

.table {
  border-collapse: collapse;
  margin: 2rem 0;
}

.table thead {
  background: var(--bg-light);
  border-bottom: 2px solid var(--border);
}

.table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--dark);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
  background: var(--bg-light);
}

/* ========================================
   CARDS
   ======================================== */

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.card-header {
  background: var(--bg-light);
  border-bottom: 2px solid var(--border);
  padding: 1.5rem;
  font-weight: 600;
  border-radius: 12px 12px 0 0;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  border-radius: 0 0 12px 12px;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 2rem 0;
}

.page-link {
  padding: 0.5rem 0.85rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.page-link:hover {
  background: var(--primary);
  color: white;
}

.page-link.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ========================================
   LOADING & ANIMATIONS
   ======================================== */

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

/* ========================================
   ADMIN PANEL STYLES
   ======================================== */

.admin-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-light);
}

.admin-sidebar {
  width: 250px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 2rem 1.5rem;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.admin-sidebar h2 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: white;
}

.admin-sidebar ul {
  list-style: none;
  padding: 0;
}

.admin-sidebar li {
  margin-bottom: 1rem;
}

.admin-sidebar a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.admin-sidebar a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
}

.admin-sidebar a.active {
  background-color: rgba(255, 255, 255, 0.3);
  color: white;
  font-weight: 600;
}

.admin-main {
  margin-left: 250px;
  flex: 1;
  padding: 2rem;
}

.admin-header {
  margin-bottom: 2rem;
}

.admin-header h1 {
  font-size: 2rem;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.admin-header p {
  color: var(--muted);
  font-size: 1rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card h3 {
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

/* ========================================
   ADMIN TABLE STYLES
   ======================================== */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.admin-table thead {
  background-color: var(--bg-light);
  border-bottom: 2px solid var(--border);
}

.admin-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--dark);
  font-size: 0.95rem;
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--dark);
}

.admin-table tbody tr:hover {
  background-color: var(--bg-light);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* ========================================
   ADMIN FORM STYLES
   ======================================== */

.admin-form {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.admin-form .form-group {
  margin-bottom: 1.5rem;
}

.admin-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--dark);
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========================================
   RESPONSIVE ADMIN
   ======================================== */

@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    left: -250px;
    z-index: 1000;
    transition: left 0.3s ease;
  }

  .admin-sidebar.active {
    left: 0;
  }

  .admin-main {
    margin-left: 0;
    padding: 1rem;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-table {
    font-size: 0.85rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.75rem 0.5rem;
  }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */


@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .tool-content {
    grid-template-columns: 1fr;
  }

  .tool-sidebar {
    position: static;
  }

  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }

  .nav-link {
    margin: 0.25rem 0;
  }

  .tool-header {
    padding: 2rem 1rem;
  }
}

@media (max-width: 576px) {
  .hero {
    padding: 4rem 1rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    width: 100%;
  }

  .upload-area {
    padding: 2rem 1rem;
  }

  main {
    padding: 1.5rem 0;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .tool-main,
  .tool-sidebar {
    width: 100%;
  }
}
