/* Layout styles — critical (FOUT/CLS) + custom alert modal. Extracted from layouts/app.blade.php. */

/* Critical (prevent FOUT / layout shift) */
/* Prevent FOUT (Flash of Unstyled Text) */
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
/* Reserve space for header */
.header { min-height: 64px; }
/* Image placeholders to prevent CLS */
img { background-color: #f3f4f6; }
img[loading="lazy"] { transition: opacity 0.3s ease; }

/* Custom Alert Modal */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes alertSlideIn {
    from { opacity: 0; transform: scale(0.9) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes alertOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes iconPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.custom-alert-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 64, 175, 0.15);
    backdrop-filter: blur(4px);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.custom-alert-overlay.show {
    display: flex;
    animation: alertOverlayIn 0.2s ease;
}
.custom-alert {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(30, 64, 175, 0.25);
    padding: 32px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    animation: alertSlideIn 0.3s ease;
}
.custom-alert-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: iconPop 0.4s ease 0.1s both;
}
.custom-alert-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
}
.custom-alert-icon.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}
.custom-alert-icon.info {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}
.custom-alert-icon svg {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: white;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.custom-alert-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 8px;
}
.custom-alert-message {
    font-size: 15px;
    color: var(--text-light);
    margin: 0 0 24px;
    line-height: 1.5;
}
.custom-alert-btn {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    border: none;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.custom-alert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}
@media (max-width: 480px) {
    .custom-alert { padding: 24px; }
    .custom-alert-icon { width: 56px; height: 56px; }
    .custom-alert-icon svg { width: 28px; height: 28px; }
}

/* =====================================================================
   ENHANCED HEADER & FOOTER  (theme-colored polish; loads after style.css)
   Header height stays 68px (.nav 64 + 4px accent border) — do not change.
   ===================================================================== */

/* ---------- Header ---------- */
.header {
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(96,165,250,.28) 0%, rgba(96,165,250,0) 45%),
    linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 150%);
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--primary-light), var(--accent), var(--primary-light)) 1;
  box-shadow: 0 6px 26px rgba(30, 64, 175, .30);
}
/* subtle top inner highlight for depth */
.header .nav::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 0;
  height: 1px;
  background: rgba(255, 255, 255, .10);
  pointer-events: none;
}
.header .brand {
  font-size: 20px;
  text-shadow: 0 1px 10px rgba(96, 165, 250, .35);
}
.header .brand::after {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .25);
}

/* Desktop nav: animated centre-grow underline + lift (mobile dropdown untouched) */
@media (min-width: 1025px) {
  .header .menu a {
    position: relative;
    border-bottom: none !important;
    padding: 8px 2px;
    transition: color .25s ease, transform .25s var(--ease-premium);
  }
  .header .menu a::after {
    content: "";
    position: absolute;
    inset-inline-start: 50%;
    inset-inline-end: 50%;
    inset-block-end: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    transition: inset-inline-start .25s var(--ease-premium), inset-inline-end .25s var(--ease-premium);
  }
  .header .menu a:hover,
  .header .menu a.active { color: #fff; transform: translateY(-1px); }
  .header .menu a:hover::after,
  .header .menu a.active::after { inset-inline-start: 0; inset-inline-end: 0; }
}

/* ---------- Footer (premium dark navy, theme blues) ---------- */
.footer {
  position: relative;
  background: linear-gradient(180deg, var(--primary-dark) 0%, #0f1b3a 100%);
  color: rgba(255, 255, 255, .72);
  border-top: none;
  padding: 56px 0 28px;
}
.footer::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-light), var(--accent), var(--primary-light));
}
.footer h4 {
  position: relative;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.footer h4::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: 0;
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.footer a { color: rgba(255, 255, 255, .80); }
.footer a:hover { color: #fff; }
.footer .footer-col p a { display: inline-block; transition: transform .2s var(--ease-premium), color .2s ease; }
.footer .footer-col p a:hover { transform: translateX(4px); }
[dir="rtl"] .footer .footer-col p a:hover { transform: translateX(-4px); }
.footer .footer-contact-item .contact-label { color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.footer .footer-contact-item a,
.footer .footer-contact-item span:not(.contact-label) { color: rgba(255, 255, 255, .85); }
.footer-grid, .footer-bottom-grid, .footer-section, .footer-newsletter, .copyright { border-color: rgba(255, 255, 255, .10) !important; }
.footer .copyright { color: rgba(255, 255, 255, .55); }

/* Footer social icons → translucent chips that lift + brand-fill on hover */
.footer .icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .15);
  color: #fff;
  box-shadow: none;
  transition: all .25s var(--ease-premium);
}
.footer .icon:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0, 0, 0, .35); color: #fff; }
.footer .icon-linkedin:hover { background: #0A66C2; border-color: #0A66C2; }
.footer .icon-github:hover  { background: #fff; border-color: #fff; color: #181717; }
.footer .icon-x:hover       { background: #000; border-color: #000; }
.footer .icon-facebook:hover{ background: #1877F2; border-color: #1877F2; }
.footer .icon-email:hover   { background: #EA4335; border-color: #EA4335; }

/* Footer language switcher on dark */
.footer .footer-language-switcher a {
  color: rgba(255, 255, 255, .80);
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
}
.footer .footer-language-switcher a:hover {
  background: rgba(96, 165, 250, .18);
  border-color: rgba(96, 165, 250, .45);
  color: #fff;
}
.footer .footer-language-switcher a.active {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: #fff;
}

/* Footer newsletter on dark */
.footer .newsletter-footer p { color: rgba(255, 255, 255, .70); }
.footer .newsletter-fields .input {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
}
.footer .newsletter-fields .input::placeholder { color: rgba(255, 255, 255, .50); }
.footer .newsletter-fields .input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, .12);
  outline: none;
}

@media (max-width: 767px) {
  .footer { padding: 40px 0 24px; }
}

/* ---------- Footer: column layout (grid areas) ---------- */
.footer-main { display: grid; align-items: start; min-width: 0; }
.footer-col { min-width: 0; }
.footer-col--contact    { grid-area: contact; }
.footer-col--links      { grid-area: links; }
.footer-col--social     { grid-area: social; }
.footer-col--language   { grid-area: language; }
.footer-col--newsletter { grid-area: newsletter; }
/* Compact inline language pills (size to content, sit side by side) */
.footer .footer-main .footer-language-switcher { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.footer .footer-main .footer-language-switcher a { justify-content: center; padding: 7px 16px; }

/* Desktop: single row — Social sits above Language in column 3 */
@media (min-width: 993px) {
  .footer-main {
    grid-template-columns: 1.1fr 1fr 1fr 1.5fr;
    grid-template-areas:
      "contact links social   newsletter"
      "contact links language newsletter";
    column-gap: 40px;
    row-gap: 22px;
  }
}

/* Tablet + Mobile: 2 columns; newsletter full-width and centered */
@media (max-width: 992px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "contact links"
      "social  language"
      "newsletter newsletter";
    gap: 30px 26px;
  }
  .footer-col--newsletter { text-align: center; max-width: 440px; margin-inline: auto; }
  .footer-col--newsletter h4 { display: inline-block; }
  .footer-col--newsletter h4::after { inset-inline-start: 50%; transform: translateX(-50%); }
  [dir="rtl"] .footer-col--newsletter h4::after { transform: translateX(50%); }
  /* Stack the form: full-line input (centered text) + full-width button below */
  .footer-col--newsletter .newsletter-fields { flex-direction: column; gap: 10px; }
  .footer-col--newsletter .newsletter-fields .input { flex: none; width: 100%; text-align: center; }
  .footer-col--newsletter .newsletter-fields .btn { width: 100%; }

  /* Social icons: keep on ONE row, sharing the column width, stay square */
  .footer .footer-col--social .icons { flex-wrap: nowrap; gap: 8px; }
  .footer .footer-col--social .icon {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: auto;
    aspect-ratio: 1;
    max-width: 46px;
  }
  /* Language buttons: ONE row, both buttons EQUAL width (text unchanged) */
  .footer .footer-col--language .footer-language-switcher { flex-wrap: nowrap; gap: 8px; }
  .footer .footer-col--language .footer-language-switcher a {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 6px;
    font-size: 13px;
    white-space: nowrap;
  }
}
@media (max-width: 560px) {
  .footer-main { gap: 26px 18px; }
}

/* ---------- Mobile side-drawer: active link text white on its blue bg ---------- */
.drawer-nav a.active { color: #fff; }
