@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
    --bs-font-sans-serif: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --dynamic-glow-color: rgba(13, 110, 253, 0.5);
    /* Default fallback glow color */
}

body {
    font-family: var(--bs-font-sans-serif);
    background-color: #f1f5f9;
}

/* Font Weights */
.fw-400 {
    font-weight: 400 !important;
}

.fw-500 {
    font-weight: 500 !important;
}

.fw-600 {
    font-weight: 600 !important;
}

.fw-700 {
    font-weight: 700 !important;
}

.fw-800 {
    font-weight: 800 !important;
}

.fw-900 {
    font-weight: 900 !important;
}

/* Font Families */
.font-header-custom {
    /* font-family: 'LibreBaskerville', Georgia, serif !important; */
    /* font-family: Inter, system-ui, -apple-system, sans-serif !important; */
    font-family: 'Instrument Serif', Georgia, serif !important;
    letter-spacing: 0.25rem;
}

.font-paragraph-custom {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
}

.text-justify {
    text-align: justify !important;
}

/* Animations */
.anim-fade-in {
    animation: fadeInTransition 0.7s ease-in-out forwards;
}

.anim-slide-up {
    animation: slideUpTransition 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.anim-zoom-in {
    animation: zoomInTransition 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fadeInTransition {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUpTransition {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomInTransition {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Masonry Layout */
.masonry-wrapper {
    display: flex;
    flex-direction: row;
    gap: 15px;
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
}

.masonry-col {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 15px;
}

.masonry-item {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.masonry-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.masonry-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

@media (max-width: 768px) {
    .masonry-wrapper {
        gap: 10px;
    }

    .masonry-col {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .masonry-wrapper {
        flex-direction: column;
    }
}

/* Flip Card Grid Container */
.flip-row-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Base Card Perspective */
.flip-letter-card {
    perspective: 1000px;
    /* Responsive sizing: default 130px, shrinks gracefully down to 90px on small screens */
    width: clamp(90px, 12vw, 150px);
    height: clamp(90px, 12vw, 150px);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Inner 3D Wrapper */
.flip-letter-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    will-change: transform;
    border-radius: 10px;
}

/* Hover & Focus Flip Effects */
.flip-letter-card:hover .flip-letter-inner,
.flip-letter-card:focus-within .flip-letter-inner,
.flip-letter-card.is-flipped .flip-letter-inner {
    transform: rotateY(180deg) translateY(-4px);
}

/* Common Face Styling */
.flip-front-face,
.flip-back-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 12px;
    overflow: hidden;
    /* Clean Subpixel Rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Front Face Styling */
.flip-front-face {
    /* Responsive font size scales down automatically */
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    z-index: 2;
}

/* Back Face Styling */
.flip-back-face {
    transform: rotateY(180deg);
    font-size: clamp(0.85rem, 1.8vw, 1.15rem);
    font-weight: 700;
    line-height: 1.25;
    word-break: break-word;
    hyphens: auto;
    text-align: center;
}

/* Mobile Adjustments (Smartphones & Small Displays) */
@media (max-width: 576px) {
    .flip-row-container {
        gap: 0.75rem;
        padding: 0.5rem;
    }
}

/* Accessibility: Accessibility setting for users with reduced motion */
@media (prefers-reduced-motion: reduce) {
    .flip-letter-inner {
        transition: transform 0.8s ease;
    }
}

/* ==========================================================================
   Sticky Responsive Sidebar & Workspace Enhancements
   ========================================================================== */
.fs-7 {
    font-size: 0.8125rem !important;
}

.fs-8 {
    font-size: 0.75rem !important;
}

.tracking-wide {
    letter-spacing: 0.05em;
}

.tracking-wider {
    letter-spacing: 0.08em;
}

.bg-slate-100 {
    background-color: #e2e8f0;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.2);
}

.workspace-viewport-wrapper {
    min-height: calc(100vh - 140px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.preview-canvas-container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.preview-canvas-container.view-pc {
    max-width: 100%;
}

.preview-canvas-container.view-tablet {
    max-width: 768px;
}

.preview-canvas-container.view-mobile {
    max-width: 375px;
}

.dynamic-section {
    padding: 40px 24px;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    position: relative !important;
    width: 100% !important;
    transition: all 0.2s ease;
}

/* Sticky Desktop Sidebar */
@media (min-width: 992px) {
    .sticky-sidebar-panel {
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
        display: flex;
        flex-direction: column;
        border-radius: 12px !important;
        overflow: hidden;
    }

    .sidebar-content-scroll {
        max-height: calc(100vh - 190px);
        overflow-y: auto;
    }
}

/* Mobile Sidebar Overrides */
@media (max-width: 991.98px) {
    .sticky-sidebar-panel {
        border-radius: 12px !important;
    }

    .sidebar-content-scroll {
        max-height: none;
    }
}

/* Accordion Card Trigger Styling */
.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
}

/* Add Content Block Grid */
.block-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.btn-block-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #334155;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: left;
    transition: all 0.15s ease-in-out;
}

.btn-block-item:hover {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    transform: translateY(-1px);
}

.btn-block-item i {
    font-size: 1rem;
    color: #64748b;
}

.btn-block-item:hover i {
    color: #1d4ed8;
}

.btn-block-item.span-2 {
    grid-column: span 2;
}

.added-block-card {
    background: #ffffff;
    border: 1px dashed #cbd5e1 !important;
    border-radius: 8px;
    padding: 12px;
    transition: border-color 0.2s ease;
    margin-bottom: 10px;
}

.added-block-card:hover {
    border-color: #94a3b8 !important;
}

.form-control-color {
    height: 31px;
    padding: 3px;
    border-radius: 6px;
    cursor: pointer;
}

/* Custom Clean Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   Extended Media Display & Interaction Effects
   ========================================================================== */
/* Standard Base Media Container */
.media-display-container,
.card-media-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: block;
    box-sizing: border-box;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.media-display-container img,
.media-display-container video,
.card-media-wrapper img,
.card-media-wrapper video {
    width: 100%;
    height: 100%;
    display: block;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform, filter;
}

/* Media Utility Classes */
.media-is-rounded {
    border-radius: 0.5rem !important;
}

.media-has-shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* --------------------------------------------------------------------------
   1. SCALE & MOTION EFFECTS
   -------------------------------------------------------------------------- */
/* Zoom In */
.hover-effect-zoom:hover img,
.hover-effect-zoom:hover video {
    transform: scale(1.08);
}

/* Zoom Out */
.hover-effect-zoom-out img,
.hover-effect-zoom-out video {
    transform: scale(1.1);
}

.hover-effect-zoom-out:hover img,
.hover-effect-zoom-out:hover video {
    transform: scale(1);
}

/* Card Lift */
.hover-effect-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.18) !important;
}

/* Tilt / Rotate */
.hover-effect-rotate:hover img,
.hover-effect-rotate:hover video {
    transform: scale(1.08) rotate(2.5deg);
}

/* Push In (3D Depress) */
.hover-effect-push:hover {
    transform: scale(0.97);
}

/* --------------------------------------------------------------------------
   2. FILTER & COLOR EFFECTS
   -------------------------------------------------------------------------- */
/* Grayscale to Full Color */
.hover-effect-grayscale img,
.hover-effect-grayscale video {
    filter: grayscale(100%);
}

.hover-effect-grayscale:hover img,
.hover-effect-grayscale:hover video {
    filter: grayscale(0%);
}

/* Brightness / Flash Boost */
.hover-effect-brightness:hover img,
.hover-effect-brightness:hover video {
    filter: brightness(1.15) contrast(1.05);
}

/* Soft Blur Reveal */
.hover-effect-blur img,
.hover-effect-blur video {
    filter: blur(4px);
    transform: scale(1.05);
}

.hover-effect-blur:hover img,
.hover-effect-blur:hover video {
    filter: blur(0px);
    transform: scale(1);
}

/* --------------------------------------------------------------------------
   3. OVERLAY & LIGHTING EFFECTS
   -------------------------------------------------------------------------- */
/* Glass Shine Sweep */
.hover-effect-shine {
    position: relative;
}

.hover-effect-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.35) 100%);
    transform: skewX(-25deg);
    transition: left 0.75s ease-in-out;
    pointer-events: none;
}

.hover-effect-shine:hover::after {
    left: 125%;
}

/* Dark Tint Overlay */
.hover-effect-darken::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.hover-effect-darken:hover::before {
    background: rgba(0, 0, 0, 0.35);
}

/* Dynamic Glow Border Effect */
.hover-effect-glow {
    transition: box-shadow 0.3s ease-in-out;
}

.hover-effect-glow:hover {
    box-shadow: 0 0 25px 3px var(--dynamic-glow-color, rgba(13, 110, 253, 0.5)) !important;
}

/* Glassmorphism Border Frame */
.hover-effect-glass {
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}