/* ==========================================
   Alin Tagar Custom Styles & Visual Builder
   ========================================== */

:root {
    --brand-blue: #05396b;
    --brand-yellow: #ffec00;
    --brand-dark: #0b132b;
    --primary: #4f46e5;
    --border-color: #e2e8f0;
}

html, body {
    max-width: 100vw;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: clip; /* 'clip' prevents horizontal scrolling without breaking sticky headers! */
    position: relative; /* Keeps absolute children contained */
    animation: pageFadeIn 0.3s ease-out forwards;
}

/* 🟢 GLOBAL STICKY HEADER FIX FOR ALL PAGES */
header {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background-color: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08) !important;
}

/* Smooth Page Entrance Animation */
@keyframes pageFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ==========================================
   VISUAL PAGE BUILDER INTERACTION STYLES
   ========================================== */

body.builder-active {
    padding-bottom: 220px !important; /* Reserve space for Bottom Edit Panel */
}

/* Selectable Page Elements */
.builder-element {
    position: relative;
    border: 2px dashed transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.builder-active .builder-element:hover {
    border-color: #93c5fd !important;
    background: rgba(239, 246, 255, 0.4);
}

body.builder-active .builder-element.selected {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
    background: rgba(239, 246, 255, 0.6);
}

/* Bottom Docked Edit Panel */
#bottom-editor-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: #ffffff;
    border-top: 2px solid #e2e8f0;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

#bottom-editor-bar.minimized {
    transform: translateY(160px);
}

.editor-bar-header {
    background: #0f172a;
    color: #ffffff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.editor-bar-body {
    padding: 16px 24px;
    display: flex;
    gap: 24px;
    align-items: center;
    overflow-x: auto;
    height: 100%;
}

.editor-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
}

.editor-control-group label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
}

.editor-control-group input, 
.editor-control-group select {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
}

.editor-control-group input:focus {
    border-color: #2563eb;
}

/* Hero Background Gradient */
.hero-overlay {
    background: linear-gradient(135deg, rgba(5, 57, 107, 0.95), rgba(11, 19, 43, 0.95));
}

.custom-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.custom-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* 🟢 REMOVE DOUBLE BROWSER FOCUS BORDER ON INPUTS & TEXTAREAS */
input:focus, 
textarea:focus, 
select:focus {
    outline: none !important;
    border-color: #05396b !important;
    box-shadow: 0 0 0 3px rgba(5, 57, 107, 0.15) !important;
}

/* ==========================================
   ATVEO-Style Admin Menu & Full-Screen Workspace
   ========================================== */

#admin-sidebar-drawer {
    width: 380px !important;
    background: #0f172a !important;
    color: #ffffff !important;
    border-left: 1px solid #1e293b !important;
}

.admin-menu-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    background: #1e293b;
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.admin-menu-btn:hover {
    background: #334155;
    transform: translateX(-3px);
}

#admin-fullscreen-workspace {
    position: fixed;
    inset: 0;
    background: #0b0f19;
    color: #ffffff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Smooth Sticky Header Glass Effect */
header.sticky {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 3D Button Color Styles */
.btn-3d-blue { background-color: #05396b !important; color: #ffffff !important; border-bottom: 5px solid #021e38 !important; }
.btn-3d-green { background-color: #16a34a !important; color: #ffffff !important; border-bottom: 5px solid #14532d !important; }
.btn-3d-red { background-color: #dc2626 !important; color: #ffffff !important; border-bottom: 5px solid #7f1d1d !important; }
.btn-3d-gold { background-color: #d97706 !important; color: #ffffff !important; border-bottom: 5px solid #78350f !important; }
.btn-3d-purple { background-color: #9333ea !important; color: #ffffff !important; border-bottom: 5px solid #581c87 !important; }

/* ==========================================
   PROFESSIONAL SWIPER CAROUSEL FIX
   ========================================== */
.swiper {
    width: 100% !important;
    position: relative;
    overflow: hidden !important;
}

.swiper-wrapper {
    display: flex !important;
}

.swiper-slide {
    height: auto !important;
    box-sizing: border-box;
}

/* Navigation Buttons Styling & Positioning */
.swiper-button-prev,
.swiper-button-next {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 40 !important; /* 🟢 Lowered from 99999 to 40 so admin drawer (z-110) covers it */
    cursor: pointer !important;
    pointer-events: auto !important;
}

.swiper-button-prev { left: -10px !important; }
.swiper-button-next { right: -10px !important; }

@media (min-width: 1024px) {
    .swiper-button-prev { left: -30px !important; }
    .swiper-button-next { right: -30px !important; }
}

/* Studio builder specific safety padding */
.pc-section .swiper-button-prev {
    left: -10px !important;
}
.pc-section .swiper-button-next {
    right: -10px !important;
}


/* Protect card avatars and images from squishing */
.swiper-slide img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover;
}

.swiper-slide .rounded-full {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
}

/* Style pagination dots */
.swiper-pagination {
    position: relative !important;
    margin-top: 20px !important;
}

.swiper-pagination-bullet {
    background: #05396b !important;
    opacity: 0.3;
    width: 8px;
    height: 8px;
    display: inline-block;
    border-radius: 50%;
    margin: 0 4px;
}

.swiper-pagination-bullet-active {
    opacity: 1 !important;
    background: #05396b !important;
}

/* ==========================================
   FINAL PERFECT SWIPER ARROW FIX
   ========================================== */
.swiper-button-prev,
.swiper-button-next {
    width: 48px !important;
    height: 48px !important;
    background-color: #05396b !important;
    color: #ffffff !important;
    border-radius: 9999px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid #ffffff !important;
    transition: background-color 0.2s ease !important;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background-color: #032545 !important;
}

/* Hide default Swiper arrow text chevrons since we use FontAwesome */
.swiper-button-prev::after,
.swiper-button-next::after {
    display: none !important;
}


/* ==========================================
   HIDE SCROLLBAR ON MOBILE DEVICES
   ========================================== */
@media (max-width: 768px) {
    html::-webkit-scrollbar, 
    body::-webkit-scrollbar,
    main::-webkit-scrollbar,
    #mobile-menu div::-webkit-scrollbar {
        display: none !important;
    }

    html, body, main, #mobile-menu div {
        -ms-overflow-style: none !important;
        scrollbar-width: none !important;
    }
}

/* Give the selected comparison matrix block a stable border */
.pc-compare-matrix.matrix-active-selection {
    box-shadow: 0 0 0 4px #f59e0b !important;
    border-radius: 1rem !important;
}

/* Prevent text selection confusion */
.pc-compare-matrix td, 
.pc-compare-matrix th {
    user-select: none !important;
}

/* Tab Styling */
.inspector-tab-btn {
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.inspector-tab-btn.active {
    border-bottom-color: #f59e0b; /* Amber-500 */
    color: #f59e0b !important;
}

/* Grouped Alignment Icons */
.align-group button.active {
    background-color: #2563eb !important; /* Blue-600 */
    color: white !important;
}

/* Custom Scrollbar for Inspector Text Boxes */
#pc-sec-title-visual::-webkit-scrollbar,
#pc-sec-desc-visual::-webkit-scrollbar,
#pc-sec-title-code::-webkit-scrollbar,
#pc-sec-desc-code::-webkit-scrollbar {
    width: 5px;
}

#pc-sec-title-visual::-webkit-scrollbar-track,
#pc-sec-desc-visual::-webkit-scrollbar-track {
    background: #0b132b; /* Match your bgSlate950 */
}

#pc-sec-title-visual::-webkit-scrollbar-thumb,
#pc-sec-desc-visual::-webkit-scrollbar-thumb {
    background: #475569; /* Slate 600 */
    border-radius: 10px;
}

#pc-sec-title-visual::-webkit-scrollbar-thumb:hover,
#pc-sec-desc-visual::-webkit-scrollbar-thumb:hover {
    background: #f59e0b; /* Amber 500 when hovering */
}