/* ==========================================================================
   SahiSize Pro (size.sahispace.com) — Unified Production Stylesheet
   Part of the SahiSpace Web Studio Ecosystem
   ========================================================================== */

/* 1. Core Theme, 4+4 Cards, PDF Workspace & 9-Dot App Switcher */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800;900&display=swap');

        body {
            font-family: 'Plus Jakarta Sans', sans-serif;
            background-color: #eaf0f6;
            color: #1e293b;
            overflow-x: hidden;
        }

        .glass-nav {
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.95);
            box-shadow: 0 15px 35px rgba(37, 99, 235, 0.08), inset 0 2px 0 rgba(255, 255, 255, 1);
        }

        .search-box {
            background: #f8fafc;
            box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(255, 255, 255, 0.9);
            border: 1px solid #cbd5e1;
        }

        .module-card-3d {
            background: linear-gradient(155deg, #ffffff 0%, #f8fafc 100%);
            border-radius: 24px;
            padding: 20px;
            cursor: pointer;
            position: relative;
            transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease, border-color 0.25s ease;
            border: 1.5px solid rgba(226, 232, 240, 0.95);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            min-height: 186px;
        }

        .module-card-3d::after {
            content: '';
            position: absolute;
            top: -50%; left: -50%; width: 200%; height: 200%;
            background: linear-gradient(45deg, transparent 46%, rgba(255,255,255,0.55) 50%, transparent 54%);
            transform: rotate(35deg) translateY(-100%);
            transition: transform 0.55s ease;
            pointer-events: none;
        }
        .module-card-3d:hover::after {
            transform: rotate(35deg) translateY(100%);
        }

        .card-blue-3d { box-shadow: 0 12px 28px -12px rgba(37, 99, 235, 0.20), 0 4px 10px -4px rgba(15, 23, 42, 0.05), inset 0 2px 0 #ffffff; }
        .card-blue-3d:hover { transform: translateY(-5px); border-color: #93c5fd; box-shadow: 0 22px 40px -12px rgba(37, 99, 235, 0.30), inset 0 2px 0 #ffffff; }

        .card-purple-3d { box-shadow: 0 12px 28px -12px rgba(124, 58, 237, 0.20), 0 4px 10px -4px rgba(15, 23, 42, 0.05), inset 0 2px 0 #ffffff; }
        .card-purple-3d:hover { transform: translateY(-5px); border-color: #c4b5fd; box-shadow: 0 22px 40px -12px rgba(124, 58, 237, 0.30), inset 0 2px 0 #ffffff; }

        .card-green-3d { box-shadow: 0 12px 28px -12px rgba(5, 150, 105, 0.20), 0 4px 10px -4px rgba(15, 23, 42, 0.05), inset 0 2px 0 #ffffff; }
        .card-green-3d:hover { transform: translateY(-5px); border-color: #6ee7b7; box-shadow: 0 22px 40px -12px rgba(5, 150, 105, 0.30), inset 0 2px 0 #ffffff; }

        .card-rose-3d { box-shadow: 0 12px 28px -12px rgba(225, 29, 72, 0.20), 0 4px 10px -4px rgba(15, 23, 42, 0.05), inset 0 2px 0 #ffffff; }
        .card-rose-3d:hover { transform: translateY(-5px); border-color: #fda4af; box-shadow: 0 22px 40px -12px rgba(225, 29, 72, 0.30), inset 0 2px 0 #ffffff; }

        .card-indigo-3d { box-shadow: 0 12px 28px -12px rgba(79, 70, 229, 0.20), 0 4px 10px -4px rgba(15, 23, 42, 0.05), inset 0 2px 0 #ffffff; }
        .card-indigo-3d:hover { transform: translateY(-5px); border-color: #a5b4fc; box-shadow: 0 22px 40px -12px rgba(79, 70, 229, 0.30), inset 0 2px 0 #ffffff; }

        .card-teal-3d { box-shadow: 0 12px 28px -12px rgba(13, 148, 136, 0.20), 0 4px 10px -4px rgba(15, 23, 42, 0.05), inset 0 2px 0 #ffffff; }
        .card-teal-3d:hover { transform: translateY(-5px); border-color: #5eead4; box-shadow: 0 22px 40px -12px rgba(13, 148, 136, 0.30), inset 0 2px 0 #ffffff; }

        .card-amber-3d { box-shadow: 0 12px 28px -12px rgba(217, 119, 6, 0.20), 0 4px 10px -4px rgba(15, 23, 42, 0.05), inset 0 2px 0 #ffffff; }
        .card-amber-3d:hover { transform: translateY(-5px); border-color: #fcd34d; box-shadow: 0 22px 40px -12px rgba(217, 119, 6, 0.30), inset 0 2px 0 #ffffff; }

        .card-sky-3d { box-shadow: 0 12px 28px -12px rgba(2, 132, 199, 0.20), 0 4px 10px -4px rgba(15, 23, 42, 0.05), inset 0 2px 0 #ffffff; }
        .card-sky-3d:hover { transform: translateY(-5px); border-color: #7dd3fc; box-shadow: 0 22px 40px -12px rgba(2, 132, 199, 0.30), inset 0 2px 0 #ffffff; }

        .icon-container-3d {
            width: 56px; height: 56px;
            border-radius: 16px;
            display: flex; align-items: center; justify-content: center;
            margin-bottom: 14px;
            box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.9), 0 10px 20px -6px rgba(15, 23, 42, 0.12);
            border: 1.5px solid rgba(255, 255, 255, 0.95);
            transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .module-card-3d:hover .icon-container-3d {
            transform: scale(1.07) rotate(-3deg);
        }

        .bg-watermark-text {
            position: absolute;
            top: 14%;
            left: 50%;
            transform: translateX(-50%);
            font-size: 19vw;
            font-weight: 900;
            color: rgba(148, 163, 184, 0.14);
            z-index: 0;
            white-space: nowrap;
            pointer-events: none;
            letter-spacing: -0.05em;
            user-select: none;
        }

        .pro-capsule {
            background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
            border: 1.5px solid #cbd5e1;
            box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.2), inset 0 3px 6px rgba(255, 255, 255, 1);
            border-radius: 28px;
        }

        :root {
            --gold-gradient: linear-gradient(135deg, #fcd34d 0%, #d97706 60%, #b45309 100%);
            --gold-shadow: #92400e;
        }
        .btn-3d-gold {
            background: var(--gold-gradient);
            color: #ffffff;
            font-weight: 800;
            border: 1px solid rgba(255, 255, 255, 0.4);
            box-shadow: 0 5px 0 var(--gold-shadow), 0 8px 20px rgba(217, 119, 6, 0.5);
            transition: all 0.1s ease-out;
            cursor: pointer;
        }
        .royal-gold-banner {
            background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 40%, #fde68a 100%);
            border: 2px solid #f59e0b;
        }
    

        :root {
            --blue-main: #2563eb;
            --blue-dark: #1d4ed8;
            --blue-shadow: #1e40af;
            --gold-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 60%, #b45309 100%);
            --gold-shadow: #92400e;
        }
        

        /* 3-Section Floating Glass Cards */
        .floating-card {
            background: #ffffff;
            border: 1px solid rgba(226, 232, 240, 0.9);
            box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
            border-radius: 24px;
        }

        .btn-3d-blue {
            background: linear-gradient(135deg, var(--blue-main), var(--blue-dark));
            color: #ffffff;
            font-weight: 700;
            border: 1px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 4px 0 var(--blue-shadow), 0 5px 12px rgba(37, 99, 235, 0.3);
            transform: translateY(-2px);
            transition: all 0.1s ease-out;
            cursor: pointer;
        }
        .btn-3d-blue:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 0 var(--blue-shadow), 0 8px 18px rgba(37, 99, 235, 0.4);
        }
        .btn-3d-blue:active {
            transform: translateY(2px);
            box-shadow: 0 1px 0 var(--blue-shadow), 0 2px 4px rgba(37, 99, 235, 0.2);
        }

        .btn-3d-white {
            background: #ffffff;
            color: #334155;
            font-weight: 600;
            border: 1px solid #cbd5e1;
            box-shadow: 0 3px 0 #94a3b8, 0 3px 6px rgba(0, 0, 0, 0.04);
            transform: translateY(-1px);
            transition: all 0.1s ease-out;
            cursor: pointer;
        }
        .btn-3d-white:hover {
            border-color: var(--blue-main);
            color: var(--blue-main);
            transform: translateY(-2px);
            box-shadow: 0 4px 0 #94a3b8, 0 6px 12px rgba(37, 99, 235, 0.1);
        }
        .btn-3d-white:active {
            transform: translateY(2px);
            background: #f1f5f9;
            box-shadow: 0 1px 0 #94a3b8;
        }

        /* Royal 3D Gold Button & Banner Styling */
        .btn-3d-gold {
            background: var(--gold-gradient);
            color: #ffffff;
            font-weight: 800;
            border: 1px solid rgba(255, 255, 255, 0.35);
            box-shadow: 0 4px 0 var(--gold-shadow), 0 6px 14px rgba(217, 119, 6, 0.4);
            transform: translateY(-2px);
            transition: all 0.1s ease-out;
            cursor: pointer;
            text-shadow: 0 1px 2px rgba(0,0,0,0.25);
        }
        .btn-3d-gold:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 0 var(--gold-shadow), 0 8px 18px rgba(217, 119, 6, 0.5);
            filter: brightness(1.05);
        }
        .btn-3d-gold:active {
            transform: translateY(2px);
            box-shadow: 0 1px 0 var(--gold-shadow), 0 2px 4px rgba(217, 119, 6, 0.3);
        }

        .royal-gold-banner {
            background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 40%, #fde68a 100%);
            border: 1.5px solid #f59e0b;
            box-shadow: 0 8px 20px -3px rgba(217, 119, 6, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.8);
            border-radius: 20px;
            transition: all 0.2s ease;
        }
        .royal-gold-banner:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 24px -4px rgba(217, 119, 6, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.9);
            border-color: #d97706;
        }

        .tool-card-pro {
            background: #ffffff;
            border: 1px solid #e2e8f0;
            border-left: 3px solid #2563eb;
            border-radius: 14px;
            transition: all 0.2s ease;
            box-shadow: 0 2px 4px rgba(0,0,0,0.02);
            cursor: pointer;
        }
        .tool-card-pro:hover {
            border-color: #2563eb;
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(37, 99, 235, 0.08);
            background: #fdfefe;
        }

        #canvasViewport {
            position: relative;
            background: #ffffff;
            box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.03);
            overflow: auto;
        }

        .draggable-overlay {
            position: absolute;
            cursor: grab;
            user-select: none;
            z-index: 40;
            touch-action: none;
            box-sizing: border-box;
        }
        .draggable-overlay:active { cursor: grabbing; }
        .draggable-overlay.unlocked:hover { outline: 2px dashed #2563eb; outline-offset: 3px; }
        .draggable-overlay.locked { cursor: default !important; outline: none !important; }

        .custom-slider {
            -webkit-appearance: none;
            width: 100%;
            height: 5px;
            background: #e2e8f0;
            border-radius: 3px;
            outline: none;
        }
        .custom-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 14px;
            height: 14px;
            background: var(--blue-main);
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }

        #cropBox {
            position: absolute;
            border: 2px solid #2563eb;
            background: rgba(37, 99, 235, 0.15);
            z-index: 60;
            cursor: move;
            box-sizing: border-box;
        }
        .crop-handle {
            position: absolute;
            width: 12px;
            height: 12px;
            background: #2563eb;
            border: 2px solid #ffffff;
            border-radius: 2px;
            z-index: 65;
            box-shadow: 0 1px 3px rgba(0,0,0,0.3);
        }
        .crop-handle.nw { top: -6px; left: -6px; cursor: nwse-resize; }
        .crop-handle.n  { top: -6px; left: calc(50% - 6px); cursor: ns-resize; }
        .crop-handle.ne { top: -6px; right: -6px; cursor: nesw-resize; }
        .crop-handle.e  { top: calc(50% - 6px); right: -6px; cursor: ew-resize; }
        .crop-handle.se { bottom: -6px; right: -6px; cursor: nwse-resize; }
        .crop-handle.s  { bottom: -6px; left: calc(50% - 6px); cursor: ns-resize; }
        .crop-handle.sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
        .crop-handle.w  { top: calc(50% - 6px); left: -6px; cursor: ew-resize; }

        /* Studio Cards Hover Zoom */
        .zoom-card-item {
            position: relative;
            transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease;
            transform-origin: center center;
        }
        .zoom-card-item:hover {
            transform: scale(1.3);
            z-index: 50 !important;
            box-shadow: 0 16px 32px -6px rgba(15, 23, 42, 0.28), 0 0 0 2px #2563eb;
        }

        /* Tray Items */
        .tray-thumb-item {
            transition: all 0.15s ease-out;
        }
        .tray-thumb-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
            border-color: #2563eb !important;
        }

        /* Floating Popover Inspector (Unclipped, Above Tray) */
        #floatingTrayPopover {
            position: absolute;
            pointer-events: none;
            z-index: 100;
            transition: opacity 0.15s ease, transform 0.15s ease;
            opacity: 0;
            transform: translateY(8px) scale(0.96);
        }
        #floatingTrayPopover.active {
            opacity: 1;
            transform: translateY(0) scale(1);
        }

        .split-card-highlight {
            animation: pulseBlue 1.6s infinite alternate;
        }
        @keyframes pulseBlue {
            0% { box-shadow: 0 0 0 3px #2563eb; transform: scale(1.08); }
            100% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.35); transform: scale(1.12); }
        }

        ::-webkit-scrollbar { width: 4px; height: 4px; }
        ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
    
    
        
        /* Tool Cards Glow Enhancement */
        .glow-aura {
            position: absolute;
            width: 120px;
            height: 120px;
            background: currentColor;
            border-radius: 50%;
            filter: blur(40px);
            opacity: 0.15;
            z-index: 0;
            top: 10px;
            left: 10px;
            transition: all 0.5s ease;
        }
        .module-card-3d:hover .glow-aura {
            opacity: 0.35;
            transform: scale(1.3);
        }
        .module-card-3d:hover .icon-container-3d span {
            transform: scale(1.15) rotate(-5deg);
        }
        .icon-container-3d span {
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

                /* SahiSpace 9-Dot App Switcher */
        .ss-app-switcher-wrap {
            position: relative;
        }
        .ss-app-switcher-btn {
            width: 40px;
            height: 40px;
            border-radius: 14px;
            background: #ffffff;
            border: 1px solid #cbd5e1;
            color: #334155;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.18s ease;
            box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
        }
        .ss-app-switcher-btn:hover,
        .ss-app-switcher-btn[aria-expanded="true"] {
            background: #eff6ff;
            border-color: #2563eb;
            color: #2563eb;
            box-shadow: 0 6px 16px rgba(37, 99, 235, 0.16);
        }
        .ss-app-switcher-menu {
            position: absolute;
            top: calc(100% + 10px);
            left: 0;
            width: 300px;
            max-width: calc(100vw - 32px);
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(18px);
            border: 1px solid #cbd5e1;
            border-radius: 22px;
            padding: 14px;
            box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.22);
            z-index: 60;
            display: none;
        }
        .ss-app-switcher-menu.open {
            display: block;
            animation: ssMenuFade 0.16s ease-out;
        }
        @keyframes ssMenuFade {
            from { opacity: 0; transform: translateY(-6px) scale(0.98); }
            to   { opacity: 1; transform: translateY(0) scale(1); }
        }
        .ss-switcher-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px;
            border-radius: 14px;
            border: 1px solid #e2e8f0;
            background: #f8fafc;
            text-decoration: none;
            transition: all 0.16s ease;
        }
        .ss-switcher-item:hover {
            background: #eff6ff;
            border-color: #3b82f6;
            transform: translateY(-1px);
        }
        .ss-switcher-item.current {
            background: #eff6ff;
            border-color: #2563eb;
            box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
        }

/* 2. Responsive Overrides, Presets & PDF 6-Card Modal */
/* Mobile & Tablet Responsive Overrides for PDF Engine */
        @media (max-width: 1024px) {
            #pdfEngineFullView {
                overflow-y: auto !important;
                height: 100vh !important;
            }
            #pdfEngineFullView #globalHeader {
                flex-wrap: wrap !important;
                gap: 8px !important;
                padding: 10px 14px !important;
            }
            #pdfWorkspaceLayout {
                flex-direction: column !important;
                overflow: visible !important;
                height: auto !important;
            }
            #pdfEngineFullView #leftSidebar {
                width: 100% !important;
                max-width: 100% !important;
                max-height: none !important;
                overflow: visible !important;
            }
            #pdfEngineFullView #centerCanvasArea {
                min-height: 460px !important;
                order: -1 !important;
            }
            #pdfEngineFullView #canvasViewport {
                width: 100% !important;
                height: 360px !important;
            }
        }
        .preset-card-hover {
            transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .preset-card-hover:hover {
            transform: translateY(-4px);
            box-shadow: 0 18px 36px -10px rgba(37, 99, 235, 0.22), 0 0 0 1.5px #3b82f6;
        }
        .pdf-modal-scroll::-webkit-scrollbar { width: 5px; }
        .pdf-modal-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
        .pdf-tool-modal-card {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-left: 3.5px solid #e11d48;
            border-radius: 16px;
            padding: 12px;
            display: flex;
            align-items: center;
            gap: 10px;
            text-align: left;
            cursor: pointer;
            transition: all 0.18s ease;
        }
        .pdf-tool-modal-card:hover {
            background: #fff1f2;
            border-color: #e11d48;
            transform: translateY(-2px);
            box-shadow: 0 8px 18px -6px rgba(225, 29, 72, 0.25);
        }

/* 3. SahiSize Pro Checkout & SahiSpace Legal Modal */
.ss-modal-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(6px); display: none; align-items: center;
    justify-content: center; z-index: 99999; padding: 16px;
  }
  .ss-modal-overlay.active { display: flex; }
  .ss-pro-modal-card {
    background: #ffffff; color: #0f172a; width: 100%; max-width: 660px;
    border-radius: 20px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35);
    overflow: hidden; border: 1px solid #e2e8f0; font-family: inherit;
    max-height: 90vh; display: flex; flex-direction: column;
  }
  .ss-pro-modal-header {
    padding: 18px 22px; background: #0f172a; color: #ffffff;
    display: flex; align-items: center; justify-content: space-between;
  }
  .ss-pro-modal-header h3 { margin: 0; font-size: 17px; font-weight: 800; }
  .ss-pro-modal-close {
    background: rgba(255,255,255,0.12); color: #fff; border: none;
    width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
    font-size: 18px; line-height: 1;
  }
  .ss-pro-modal-close:hover { background: rgba(255,255,255,0.22); }
  .ss-pro-modal-body {
    padding: 22px; overflow-y: auto; font-size: 13.5px; line-height: 1.65; color: #334155;
  }
  .ss-policy-tabs {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0; padding-bottom: 12px;
  }
  .ss-policy-tab {
    padding: 6px 12px; border-radius: 8px; border: 1px solid #cbd5e1;
    background: #f8fafc; color: #334155; font-size: 12px; font-weight: 700;
    cursor: pointer; transition: all 0.15s ease;
  }
  .ss-policy-tab:hover { border-color: #2563eb; color: #2563eb; }
  .ss-policy-tab.active {
    background: #2563eb; color: #ffffff; border-color: #2563eb;
  }
  .ss-plan-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 12px; margin: 14px 0 18px;
  }
  .ss-plan-box {
    border: 2px solid #e2e8f0; border-radius: 14px; padding: 14px 12px;
    text-align: center; cursor: pointer; transition: all 0.2s ease;
    background: #f8fafc; position: relative;
  }
  .ss-plan-box.selected {
    border-color: #2563eb; background: #eff6ff;
    box-shadow: 0 8px 20px -6px rgba(37,99,235,0.25);
  }
  .ss-plan-price { font-size: 24px; font-weight: 800; color: #0f172a; margin: 4px 0; }
  .ss-plan-name { font-size: 13px; font-weight: 700; color: #2563eb; }
  .ss-plan-duration { font-size: 11.5px; color: #64748b; }
  .ss-nonrefund-box {
    background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
    padding: 12px; margin: 14px 0; font-size: 12.5px; color: #92400e;
    display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  }
  .ss-pay-btn {
    width: 100%; padding: 14px; border-radius: 12px; border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #ffffff;
    font-weight: 700; font-size: 15px; cursor: pointer;
  }
  .ss-pay-btn:disabled { background: #94a3b8; cursor: not-allowed; }
  .ss-pro-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff;
    padding: 6px 12px; border-radius: 999px; font-size: 11px; font-weight: 800;
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.28);
  }
