/**
 * JaduGo Theme - Main Stylesheet
 * Two-row header: White bg, Red brand, icon nav tabs
 * Dynamic color via CSS custom properties --jadugo-primary
 *
 * @package JaduGo
 * @version 3.0.0
 */

/* ==========================================================================
   CSS RESET & BASE
   ========================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #111827;
    background: #f9fafb;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--jadugo-primary, #2563EB);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--jadugo-primary-dark, #1E40AF);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}

/* ==========================================================================
   HEADER — Two-Row Design (White BG, Red Brand)
   ========================================================================== */

.jadugo-header {
    background: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* --- Row 1: Brand Bar (Top) --- */
.jadugo-header-top {
    border-bottom: 1px solid #f3f4f6;
}

.jadugo-header-top-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}

/* Hamburger Button */
.jadugo-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    flex-shrink: 0;
}

.jadugo-hamburger span {
    width: 22px;
    height: 2.5px;
    background: #374151;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.jadugo-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.jadugo-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.jadugo-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Brand (center) */
.jadugo-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.jadugo-brand-logo {
    height: 32px;
    width: auto;
    border-radius: 4px;
}

/* v5.0.0: Brand text — Blue → Purple gradient text (like the reference design).
   background-clip:text renders a gradient through the glyphs; the plain color
   is the graceful fallback for browsers without support. */
.jadugo-brand-text {
    color: var(--jadugo-primary, #2563EB);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(100deg, var(--jadugo-primary, #2563EB) 20%, var(--jadugo-secondary, #7C3AED) 85%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: opacity 0.25s ease;
}

/* Admin-written HTML site names (spans/colours) keep their own styling —
   transparent fill would break them, so only plain-text brands get the
   gradient. v1.0.1 (Website Name topic FIX): the reset now covers EVERY
   whitelisted child element (b, strong, i, em, u, s, small, mark, sub, sup,
   font — not just span): previously <b style="color:…">Go</b> and
   <font color="…">Go</font> kept the transparent text-fill and showed the
   blue→purple gradient instead of the admin's colour. */
.jadugo-brand-text span,
.jadugo-brand-text b,
.jadugo-brand-text strong,
.jadugo-brand-text i,
.jadugo-brand-text em,
.jadugo-brand-text u,
.jadugo-brand-text s,
.jadugo-brand-text small,
.jadugo-brand-text mark,
.jadugo-brand-text sub,
.jadugo-brand-text sup,
.jadugo-brand-text font,
.jadugo-brand-text img {
    -webkit-text-fill-color: currentColor;
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
}

/* v1.0.1 (Website Name topic FIX): when the admin's website name is HTML
   (header.php prints the .jadugo-brand-custom class in that case), the parent
   gradient is switched OFF entirely so the admin's own font, style and colour
   code renders EXACTLY as written — wrapped parts keep the admin's colours.
   COLOUR PRIORITY RULE (v1.0.1 fix): the admin's colour is TOP priority. The
   theme's Primary / Secondary colours must NEVER tint the website name:
     - the base `color: var(--jadugo-primary)` from .jadugo-brand-text above,
     - the global `a { color: var(--jadugo-primary) }` rule (the brand is an
       <a> tag), and
     - `a:hover { color: var(--jadugo-primary-dark) }`
   are all overridden here with the neutral ink colour (#111827) the rest of
   the site text uses — so unwrapped text shows a neutral colour, wrapped text
   shows the admin's exact inline colour, and hover repaints nothing. */
.jadugo-brand-text.jadugo-brand-custom {
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: currentColor;
    color: #111827;
}

/* Same colour-priority guard on hover: the generic brand hover rule below
   only changes opacity, but this explicit rule makes sure NO future/other
   hover rule can ever push the primary-dark colour back into the name. */
.jadugo-brand:hover .jadugo-brand-text.jadugo-brand-custom,
a.jadugo-brand:hover .jadugo-brand-text.jadugo-brand-custom {
    color: #111827;
}

.jadugo-brand:hover .jadugo-brand-text {
    opacity: 0.85;
}

/* Right spacer to center the brand */
.jadugo-header-spacer {
    width: 40px;
    flex-shrink: 0;
}

/* --- Row 2: Icon Navigation Tabs (v5.0.0: blue active + animated indicator) --- */
.jadugo-header-nav {
    background: #FFFFFF;
    border-bottom: 1px solid #F1F5F9;
}

.jadugo-nav-tabs {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 56px;
    gap: 0;
}

.jadugo-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 12px;
    color: #64748B;
    font-size: 20px;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, box-shadow 0.3s ease;
    min-width: 56px;
    border-radius: 10px;
}

/* v5.1.0 (Topic 9): PROFESSIONAL HOVER — every menu item's icon gets its own
   gradient icon-background tile on hover (and while active), the label turns
   theme-blue, and the whole tab lifts with a soft glow. */
.jadugo-tab i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 17px;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.jadugo-tab:hover {
    color: var(--jadugo-primary, #2563EB);
    background: linear-gradient(180deg, rgba(219, 234, 254, 0.55), rgba(245, 243, 255, 0.35));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.14);
}

.jadugo-tab:hover i {
    background: linear-gradient(135deg, var(--jadugo-primary, #2563EB), var(--jadugo-secondary, #7C3AED));
    color: #ffffff;
    transform: translateY(-1px) scale(1.06);
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.38);
}

.jadugo-tab:hover .jadugo-tab-label {
    color: var(--jadugo-primary, #2563EB);
}

.jadugo-tab .jadugo-tab-label {
    transition: color 0.3s ease;
}

.jadugo-tab.active {
    color: var(--jadugo-primary, #2563EB);
}

/* Active tab icon — same gradient tile as hover, so the current page always stands out */
.jadugo-tab.active i {
    background: linear-gradient(135deg, var(--jadugo-primary, #2563EB), var(--jadugo-secondary, #7C3AED));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
}

/* Active tab indicator pill — gradient blue → purple
   v2.0.0 (Animation Audit topic) FIX: the pill used to grow by animating
   `width` (a LAYOUT property — layout recalc every frame). It now scales in
   with transform:scaleX (compositor-only) — same grow-in look. */
.jadugo-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: linear-gradient(90deg, var(--jadugo-primary, #2563EB), var(--jadugo-secondary, #7C3AED));
    border-radius: 3px 3px 0 0;
    animation: jadugoTabPillIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes jadugoTabPillIn {
    from { transform: translateX(-50%) scaleX(0); opacity: 0; }
    to   { transform: translateX(-50%) scaleX(1); opacity: 1; }
}

/* Tab label (hidden on very small screens, shown on larger) */
.jadugo-tab-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1;
}

/* ==========================================================================
   MOBILE NAVIGATION (Slide-out) — v5.0.0 redesign: opens from the LEFT,
   gradient header, blue/purple design language (full styles live inline in
   header.php so they always win over WooCommerce plugin CSS; these are the
   base fallbacks).
   ========================================================================== */

.jadugo-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 9998;
    transition: opacity 0.35s ease;
}

.jadugo-nav-overlay.active {
    display: block;
}

.jadugo-nav-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 86vw;
    height: 100vh;
    background: #FFFFFF;
    z-index: 9999;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 20px 0 60px rgba(15, 23, 42, 0.25);
    overflow-y: auto;
    transform: translateX(-105%);
    border-radius: 0 20px 20px 0;
}

.jadugo-nav-mobile.active {
    transform: translateX(0);
}

.jadugo-nav-mobile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 18px;
}

.jadugo-nav-mobile-brand {
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.jadugo-nav-mobile-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 18px;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: none;
}

.jadugo-nav-mobile-link:hover,
.jadugo-nav-mobile-link.active {
    color: var(--jadugo-primary, #2563EB);
    background: linear-gradient(90deg, var(--jadugo-primary-light, #DBEAFE), #F5F3FF);
    border-left: none;
}

.jadugo-nav-mobile-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.jadugo-nav-mobile-logout {
    margin-top: auto;
    color: #334155;
    border-top: 1px solid #E2E8F0;
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */

.jadugo-main {
    min-height: calc(100vh - 104px - 56px);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.jadugo-footer {
    background: #111827;
    padding: 16px 20px;
    text-align: center;
}

.jadugo-footer-inner p {
    color: #9ca3af;
    font-size: 12px;
}

.jadugo-footer-inner strong {
    color: #fff;
}

/* ==========================================================================
   FORM PREVIEW MODAL — v1.0.0: FULLSCREEN preview.
   Clicking a form's Preview/View button now takes over the WHOLE screen
   (no new page / tab opens). A small Back button floats at the top-left
   and returns the user to the page they came from.
   ========================================================================== */

.mv-modal-overlay {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    padding: 0;
    animation: mv-modal-in 0.25s ease;
}

@keyframes mv-modal-in {
    from { opacity: 0; transform: scale(0.985); }
    to   { opacity: 1; transform: scale(1); }
}

/* Small Back button — top-left, floating above the preview */
.mv-modal-back {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #2563EB, #7C3AED);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 9px 16px 9px 14px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.mv-modal-back:hover {
    transform: translateX(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.mv-modal-back i {
    font-size: 12px;
}

/* The preview iframe fills the entire screen */
.mv-modal-body {
    flex: 1;
    overflow: hidden;
}

.mv-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #f9fafb;
}

/* ==========================================================================
   v1.1.0 (Update 1 — Form View button loading animation):
   A branded loading animation now covers the fullscreen form preview modal
   for EXACTLY as long as the form takes to open inside the iframe. The
   moment the iframe finishes loading, the loader fades out fast (0.2 s)
   and the form shows — no wasted time, no blank screen.
   ========================================================================== */

.mv-modal-loader {
    position: absolute;
    inset: 0;
    z-index: 1; /* above the iframe, below the Back button (z-index: 2) */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: #f9fafb; /* same as the iframe background — seamless reveal */
    transition: opacity 0.2s ease;
}

.mv-modal-loader.mv-modal-loader-hidden {
    opacity: 0;
    pointer-events: none;
}

/* ---- shared JaduGo spinner (dual counter-rotating rings + pulsing icon) ---- */
.jdg-spin-wrap {
    position: relative;
    width: 68px;
    height: 68px;
}

.jdg-spin-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 5px solid rgba(37, 99, 235, 0.12);
    border-top-color: var(--jadugo-primary, #2563EB);
    border-right-color: var(--jadugo-secondary, #7C3AED);
    animation: jdg-spin 0.85s linear infinite;
}

.jdg-spin-ring2 {
    position: absolute;
    inset: 11px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom-color: var(--jadugo-secondary, #7C3AED);
    border-left-color: rgba(124, 58, 237, 0.35);
    animation: jdg-spin-rev 1.3s linear infinite;
}

@keyframes jdg-spin { to { transform: rotate(360deg); } }
@keyframes jdg-spin-rev { to { transform: rotate(-360deg); } }

.jdg-spin-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--jadugo-primary, #2563EB);
    animation: jdg-pulse 1.4s ease-in-out infinite;
}

@keyframes jdg-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50%      { transform: scale(1.15); opacity: 1; }
}

.mv-modal-loader .jdg-spin-text {
    font-size: 14px;
    font-weight: 600;
    color: #6B7280;
    letter-spacing: 0.2px;
    font-family: 'Inter', sans-serif;
}

/* animated trailing dots ("Loading…") */
.jdg-dots span {
    display: inline-block;
    padding: 0 1px;
    animation: jdg-dot 1.2s infinite;
}
.jdg-dots span:nth-child(2) { animation-delay: 0.2s; }
.jdg-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes jdg-dot {
    0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
    30%           { opacity: 1;    transform: translateY(-2px); }
}

/* ==========================================================================
   WP ADMIN TABLE STYLING
   ========================================================================== */

.wp-list-table {
    border-radius: 8px;
    overflow: hidden;
}

.wp-list-table thead th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.button-primary {
    background: linear-gradient(135deg, var(--jadugo-primary, #2563EB), var(--jadugo-primary-dark, #1E40AF)) !important;
    border-color: var(--jadugo-primary-dark, #1E40AF) !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2) !important;
}

.button-primary:hover {
    background: linear-gradient(135deg, #60A5FA, var(--jadugo-primary, #2563EB)) !important;
    border-color: var(--jadugo-primary, #2563EB) !important;
}

.notice-success {
    border-left-color: var(--jadugo-primary, #2563EB) !important;
}

/* ==========================================================================
   COPY TOOLTIP
   ========================================================================== */

.jadugo-copy-tooltip {
    position: fixed;
    background: #111827;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 9999;
    pointer-events: none;
    animation: jadugoFadeOut 2s forwards;
}

@keyframes jadugoFadeOut {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
}

/* ==========================================================================
   UTILITY CLASSES (shared across pages)
   ========================================================================== */

.mv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}

.mv-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.mv-empty-icon {
    width: 72px;
    height: 72px;
    background: var(--jadugo-primary-light, #DBEAFE);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--jadugo-primary, #2563EB);
    font-size: 28px;
}

.mv-empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 4px;
}

.mv-empty-state p {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

/* ==========================================================================
   v2.0.0 (Animation Audit topic): GLOBAL REDUCED-MOTION GUARD
   Professional animation standard: visitors who prefer reduced motion
   (OS-level setting) get every theme animation settled instantly instead
   of playing. Animations finish at their FINAL state (fill both/forwards),
   so no content is ever hidden — the site simply appears static.
   Front-end wide: every page template, the smart slider, feature cards,
   auth pages, webcam page, video page, checkout, dashboard, profile, etc.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
