/* ==========================================================================
   MD Printer - Interactive Paper GSM & Thickness Guide Stylesheet
   Mobile-First Tactile Paper Physics, Slider & Substrate Simulator
   ========================================================================== */

/* Modal Dialog Sizing */
#paperGuideModal .site-modal-dialog {
    max-width: 960px;
    width: 95%;
    margin: 20px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.4);
}

#paperGuideModal .site-modal-content {
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: #ffffff;
}

#paperGuideModal .site-modal-header {
    background: linear-gradient(135deg, #0b132b 0%, #1c2541 100%);
    color: #ffffff;
    padding: 18px 24px;
    border-bottom: 3px solid var(--cmyk-cyan, #00aeef);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#paperGuideModal .site-modal-title {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

#paperGuideModal .site-modal-close {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

#paperGuideModal .site-modal-close:hover {
    background: #ef4444;
    color: #ffffff;
    transform: rotate(90deg);
}

/* Category Filter Tabs */
.paper-cat-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.paper-cat-tabs::-webkit-scrollbar {
    display: none;
}

.paper-cat-tab-btn {
    white-space: nowrap;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.paper-cat-tab-btn:hover {
    border-color: var(--cmyk-cyan, #00aeef);
    color: var(--cmyk-cyan, #00aeef);
    background: rgba(0, 174, 239, 0.05);
}

.paper-cat-tab-btn.active {
    background: var(--cmyk-cyan, #00aeef);
    border-color: var(--cmyk-cyan, #00aeef);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 174, 239, 0.3);
}

/* Main Studio Layout */
.paper-guide-body {
    padding: 20px 24px;
}

.paper-guide-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
    align-items: start;
}

/* Left: Interactive Physics Stage & Slider */
.paper-physics-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

/* Interactive Slider Box */
.gsm-slider-section {
    margin-bottom: 22px;
}

.gsm-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.gsm-slider-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gsm-slider-current-badge {
    background: linear-gradient(135deg, var(--cmyk-cyan, #00aeef), #0284c7);
    color: #ffffff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 1.15rem;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(0, 174, 239, 0.35);
    letter-spacing: 0.5px;
}

/* Range Input Styling */
.gsm-range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 8px;
    background: linear-gradient(90deg, #93c5fd 0%, #38bdf8 40%, #0284c7 70%, #0369a1 100%);
    outline: none;
    margin: 14px 0 10px 0;
    cursor: pointer;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

.gsm-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: 4px solid var(--cmyk-cyan, #00aeef);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25), 0 0 0 4px rgba(0, 174, 239, 0.2);
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gsm-range-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.18);
    box-shadow: 0 4px 14px rgba(0,0,0,0.3), 0 0 0 6px rgba(0, 174, 239, 0.3);
}

.gsm-range-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: 4px solid var(--cmyk-cyan, #00aeef);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    cursor: grab;
}

/* Step Milestone Markers */
.gsm-milestones {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
    margin-top: 4px;
}

.gsm-milestone-tick {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: color 0.15s ease;
    user-select: none;
}

.gsm-milestone-tick:hover,
.gsm-milestone-tick.active {
    color: var(--cmyk-cyan, #00aeef);
    font-weight: 900;
}

/* 3D Paper Flex Physics Visualizer Stage */
.paper-physics-stage {
    position: relative;
    background: radial-gradient(circle at 50% 30%, #f8fafc 0%, #edf2f7 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    height: 230px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.04);
}

/* Grid Background Lines for Rigidity Reference */
.stage-grid-lines {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to right, rgba(203, 213, 225, 0.35) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(203, 213, 225, 0.35) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

/* Zero Reference Line */
.stage-zero-line {
    position: absolute;
    left: 45px;
    right: 30px;
    top: 50%;
    height: 1px;
    border-top: 1px dashed rgba(148, 163, 184, 0.6);
    pointer-events: none;
}
.stage-zero-label {
    position: absolute;
    right: 8px;
    top: 48%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
}

/* Physics Grip Clamp (Left Hand side holding the paper) */
.stage-clamp {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 70px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 6px;
    box-shadow: 4px 0 12px rgba(0,0,0,0.25);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.clamp-screw {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
}

/* Animated Flexible Paper Sheet */
.physics-paper-sheet {
    position: absolute;
    left: 44px;
    top: 50%;
    width: 250px;
    height: 80px;
    transform-origin: 0% 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    border-radius: 0 4px 4px 0;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 16px;
    user-select: none;
    cursor: pointer;
    overflow: hidden;
}

.paper-sheet-texture-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.15;
}

.paper-spec-tag {
    font-size: 0.72rem;
    font-weight: 900;
    color: var(--cmyk-cyan, #00aeef);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.paper-sheet-label {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.paper-thickness-chip {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    margin-top: 4px;
}

/* Paper Flick Animation Class */
@keyframes paperFlickLight {
    0% { transform: translateY(-50%) rotate(24deg); }
    20% { transform: translateY(-50%) rotate(38deg); }
    40% { transform: translateY(-50%) rotate(16deg); }
    60% { transform: translateY(-50%) rotate(30deg); }
    80% { transform: translateY(-50%) rotate(22deg); }
    100% { transform: translateY(-50%) rotate(26deg); }
}

@keyframes paperFlickMedium {
    0% { transform: translateY(-50%) rotate(12deg); }
    25% { transform: translateY(-50%) rotate(22deg); }
    50% { transform: translateY(-50%) rotate(8deg); }
    75% { transform: translateY(-50%) rotate(15deg); }
    100% { transform: translateY(-50%) rotate(12deg); }
}

@keyframes paperFlickStiff {
    0% { transform: translateY(-50%) rotate(2deg); }
    30% { transform: translateY(-50%) rotate(6deg); }
    60% { transform: translateY(-50%) rotate(0deg); }
    80% { transform: translateY(-50%) rotate(3deg); }
    100% { transform: translateY(-50%) rotate(2deg); }
}

.paper-flick-anim-light {
    animation: paperFlickLight 0.9s cubic-bezier(0.25, 1, 0.5, 1) !important;
}
.paper-flick-anim-med {
    animation: paperFlickMedium 0.6s cubic-bezier(0.25, 1, 0.5, 1) !important;
}
.paper-flick-anim-stiff {
    animation: paperFlickStiff 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

/* Interactive Flick Button */
.paper-flick-cta {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #334155;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.paper-flick-cta:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    transform: translateY(-1px);
}

/* Right: Tactile Metrics & Real World Anchor */
.paper-intel-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

/* Real-World Anchor Box ("Feels Like") */
.feels-like-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1.5px solid #86efac;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
}
.feels-like-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #15803d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.feels-like-content {
    font-size: 0.98rem;
    font-weight: 800;
    color: #14532d;
    line-height: 1.35;
}

/* 4 Metrics Matrix */
.tactile-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.tactile-metric-tile {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
}
.tactile-metric-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.tactile-metric-val {
    font-size: 1.15rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
}
.tactile-metric-sub {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
}

/* Stiffness & Opacity Progress Bar */
.meter-bar-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}
.meter-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cmyk-cyan, #00aeef), var(--cmyk-magenta, #ee0083));
    border-radius: 4px;
    transition: width 0.35s ease;
}

/* Recommended For Box */
.recommended-box {
    margin-bottom: 20px;
}
.recommended-box-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.recommended-tags-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.rec-tag-pill {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #bae6fd;
}

/* Substrate Finish Swatches Selector */
.swatches-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px dashed #e2e8f0;
}
.swatches-section-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.swatches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}
.swatch-card {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.swatch-card:hover {
    border-color: var(--cmyk-cyan, #00aeef);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.swatch-card.active {
    border-color: var(--cmyk-cyan, #00aeef);
    background: rgba(0, 174, 239, 0.05);
    box-shadow: 0 0 0 2px rgba(0, 174, 239, 0.2);
}
.swatch-icon-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    margin: 0 auto 6px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.swatch-name {
    font-size: 0.74rem;
    font-weight: 800;
    color: #0f172a;
    display: block;
}
.swatch-tagline {
    font-size: 0.65rem;
    color: #64748b;
    display: block;
}

/* Tricity Free Swatch Book Banner */
.tricity-swatch-banner {
    margin-top: 20px;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    border-radius: 14px;
    padding: 16px 20px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tricity-swatch-banner-text h4 {
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 800;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tricity-swatch-banner-text p {
    color: #94a3b8;
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.4;
}

.tricity-swatch-cta-btn {
    flex-shrink: 0;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.tricity-swatch-cta-btn:hover {
    background: #15803d;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.45);
    color: #ffffff;
}

/* Configurator Inline Helper Trigger Button */
.paper-guide-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 174, 239, 0.1);
    color: var(--cmyk-cyan, #0085b2);
    border: 1px solid rgba(0, 174, 239, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    vertical-align: middle;
}
.paper-guide-trigger-btn:hover {
    background: var(--cmyk-cyan, #0085b2);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 174, 239, 0.3);
}

/* Configurator Notice Banner */
.config-paper-guide-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1.5px solid #bae6fd;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
}
.config-paper-guide-banner-text {
    font-size: 0.85rem;
    color: #0369a1;
    font-weight: 700;
    line-height: 1.35;
}

/* Mobile Responsive Optimization */
@media (max-width: 868px) {
    .paper-guide-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .paper-physics-stage {
        height: 200px;
    }
    
    .physics-paper-sheet {
        width: 190px;
        height: 70px;
    }
    
    .tricity-swatch-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }
    
    .tricity-swatch-cta-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .paper-guide-body {
        padding: 14px;
    }
    
    .paper-physics-card,
    .paper-intel-card {
        padding: 14px;
    }
    
    .gsm-milestones {
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
    }
    
    .gsm-milestone-tick {
        font-size: 0.68rem;
    }
    
    .tactile-metrics-grid {
        grid-template-columns: 1fr;
    }
}
