/* ==========================================================================
   KPM LTD — Global stylesheet
   Customs Clearance & Brokerage
   ========================================================================== */

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

:root {
  --bg-start: #000814;
  --bg-end: #001d3d;
  --blue: #2563EB;
  --blue-light: #60A5FA;
  --amber: #F59E0B;
  --text: #ffffff;
  --text-muted: #94A3B8;
  --text-soft: #E2E8F0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Animated background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(0, 51, 102, 0.15) 0%, transparent 50%);
  z-index: 0;
  animation: gradientShift 15s ease infinite;
  pointer-events: none;
}

@keyframes gradientShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(0, 8, 20, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand img {
  height: 40px;
  width: auto;
}

.brand span {
  color: var(--text);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--blue-light);
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--blue);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.btn-contact:hover {
  background: #1d4ed8;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.4);
}

.btn-contact svg {
  width: 16px;
  height: 16px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.mobile-menu {
  display: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 8, 20, 0.95);
  backdrop-filter: blur(12px);
  padding: 1rem 1.5rem;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.mobile-menu a:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.25rem 3rem;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  width: 100%;
  text-align: center;
  animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Home page
   ========================================================================== */
.logo-container {
  margin-bottom: 3rem;
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.logo {
  max-width: 280px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(37, 99, 235, 0.3));
}

.logo-container:hover .logo {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 10px 30px rgba(37, 99, 235, 0.3)); }
  50% { filter: drop-shadow(0 10px 40px rgba(37, 99, 235, 0.5)); }
}

.main-heading {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  animation: slideDown 0.8s ease-out 0.2s both;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.company-info {
  margin-bottom: 2rem;
  animation: slideDown 0.8s ease-out 0.4s both;
}

.company-name {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: 0.15em;
}

.tagline {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--amber);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.divider {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  margin: 2.5rem auto;
  animation: slideDown 0.8s ease-out 0.6s both;
}

.service-text {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  color: var(--blue-light);
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
  animation: slideDown 0.8s ease-out 0.8s both;
}

.subtext {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.6;
  animation: slideDown 0.8s ease-out 1s both;
}

.cta-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: slideUp 0.8s ease-out 1.2s both;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  border-radius: 0.6rem;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.4);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  border-radius: 0.6rem;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: var(--blue-light);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-ghost:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.5);
}

/* ==========================================================================
   Cards / forms (contact + admin)
   ========================================================================== */
.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.8s ease-out 0.3s both;
}

.page-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  animation: slideDown 0.8s ease-out both;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  animation: slideDown 0.8s ease-out 0.15s both;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 0.5rem;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-control::placeholder {
  color: #64748B;
}

.form-control:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 130px;
}

.btn-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--blue);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.btn-submit:hover {
  background: #1d4ed8;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.4);
}

.form-note {
  font-size: 0.75rem;
  color: #64748B;
  text-align: center;
  margin-top: 1rem;
}

/* Alerts */
.alert {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-radius: 0.6rem;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.alert svg { width: 20px; height: 20px; flex-shrink: 0; }

.alert-success {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.alert-error {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Success block */
.success-block {
  text-align: center;
  padding: 2rem 0;
}

.success-block .check {
  width: 64px;
  height: 64px;
  color: #4ade80;
  margin: 0 auto 1rem;
}

.success-block h3 {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.success-block p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Quick contact row */
.quick-contact {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.quick-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.quick-contact a:hover { color: var(--blue-light); }
.quick-contact svg { width: 16px; height: 16px; color: var(--amber); }

/* ==========================================================================
   Admin table
   ========================================================================== */
.admin-wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 1.25rem 3rem;
}

.table-scroll {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

table.submissions {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
}

table.submissions th {
  text-align: left;
  padding: 1rem;
  background: rgba(37, 99, 235, 0.15);
  color: var(--text-soft);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid rgba(37, 99, 235, 0.2);
}

table.submissions td {
  padding: 1rem;
  color: var(--text-soft);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

table.submissions tr:hover td {
  background: rgba(37, 99, 235, 0.06);
}

table.submissions td.msg {
  min-width: 260px;
  white-space: pre-wrap;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.count-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: var(--blue-light);
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.75rem;
}

/* Login box */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.25rem 3rem;
  position: relative;
  z-index: 1;
}

.login-box {
  max-width: 400px;
  width: 100%;
}

.logout-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s ease;
}
.logout-link:hover { color: var(--blue-light); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .menu-toggle { display: block; }
  .logo { max-width: 220px; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .logo { max-width: 180px; }
  .card { padding: 1.75rem 1.25rem; }
}
