* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Sora', sans-serif;
    font-size:15px;
    line-height: 1.1rem;
    background: linear-gradient(135deg, #f5f7ff 0%, #eef2fa 100%);
    min-height: 100vh;
    color: #1a2c3e;
}

h1,h2,h3,h4 { font-family: "Bebas Neue", sans-serif; line-height:1em; margin-bottom:.2rem; }
h1 { font-size:44px; }
h2 { font-size:40px; }
h3 { font-size:34px; }
h4 { font-size:26px; }
.hline { display:block; background-color:#2d6a4f; height:4px; margin:.7rem 0; }
.survey-description { font-size:.94em; margin:.7rem 0 1rem 0; opacity:.9; }
.note { font-size:.86em; margin:1rem 0; }
i.fa-circle-info { color:#0099CC; }
.header { margin-bottom:2rem; display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:.5rem; }
.content-box { position:relative; margin-top:1.3rem; }
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}
.card {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(2px);
    border-radius: 1.5rem;
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.6);
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
    box-shadow: 0 24px 40px -16px rgba(0,0,0,0.12);
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    font-weight: 600;
    border-radius: 2rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    background: white;
    color: #1e3a5f;
    border: 1px solid #dce5f0;
    text-decoration: none;
}
.btn-reset { bottom:10px; margin-top:15px; cursor:pointer; display: inline-flex; justify-content:center; align-items:center; width:30px; height:30px; border:0; border-radius:50%; background-color:rgba(0,0,0, .3); }
.btn-primary { background:#2E7D32; color:white; width:100%; margin-top:.8rem; padding:1rem; font-size:1.1em; border-radius:2rem; border:none; font-weight:bold; cursor:pointer; box-shadow: 0 4px 8px rgba(45,106,79,0.2); }
.btn-primary:hover {
    background: #1f543e;
    transform: translateY(-2px);
}
.btn-outline {
    border: 1px solid #cbdde9;
    background: white;
}
.btn-outline:hover {
    background: #f8fafc;
    border-color: #2d6a4f;
}
input, textarea, select {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius:.6rem;
    font-size: 1rem;
    border: 1.5px solid #e2e8f0;
    transition: all 0.2s;
    background: white;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #2d6a4f;
    box-shadow: 0 0 0 3px rgba(45,106,79,0.2);
}
input[type=radio], input[type=checkbox] { width:auto; }
label { margin-bottom: 0.2rem; display: block; font-size:.9rem; padding:0 .3rem; color: #0f2c3d; }
input[type="radio"], input[type="checkbox"] { margin-right: 5px; }
.answer-area { justify-content:flex-start; align-items:flex-start; flex-wrap: wrap; gap:3%; }
label:has(input[type="radio"]), label:has(input[type="checkbox"]) { display:inline-block; flex: 1 1 calc(32% - 20px);  margin:5px 2% 5px 0; }

span { font-size:.85rem; }
.navbar {
    background: white;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.logo {
    font-size: 1.7rem;
    font-weight: 800;
    background: linear-gradient(135deg, #2d6a4f, #1b4d3e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.survey-grid {
    display: flex; flex-direction:column;
    /*grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));*/
    gap: 1.8rem;
    margin-top: 2rem;
}
.survey-card {
    background: #ffffffdd;
    border-radius: 1rem;
    padding: 1.5rem;
    border-left: 5px solid #2d6a4f;
}
.survey-card h3 { font-size:2rem; margin-bottom:.5rem; }
.survey-card p { font-size:.9rem; margin:.8rem 0; }
/* Draggable card */
.draggable-card {
    position: fixed;
    width: min(90%, 650px);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    border-radius: 2rem;
    box-shadow: 0 25px 45px rgba(0,0,0,0.3);
    z-index: 10;
    cursor: grab;
    will-change: transform;
}
.draggable-card:active { cursor: grabbing; }
.card-inner { padding: 2rem; }
/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
}
.badge-active { background: #e0f2e9; color: #1e5a3a; }
.badge-inactive { background: #fde5e8; color: #b91c1c; }
.badge-expiry { background: #fff3e0; color: #b85c00; }
.question-card, .group-card, .field-item { background:#f9fbfd; border-radius:.2rem; padding:.8rem; margin-bottom:1rem; border-left:4px solid #2d6a4f; }
/* Collapsible question card styles */
.question-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:0.5rem; }
.question-card {
    transition: all 0.3s ease;
}
.question-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}
.question-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.group-name {
    font-size: 0.8rem;
    color: #666;
}
.collapse-toggle {
    cursor: pointer;
    color: #2d6a4f;
    font-size: 0.9rem;
    transition: transform 0.2s;
    background: none;
    border: none;
    padding: 0.2rem 0.5rem;
}
.collapse-toggle.collapsed i {
    transform: rotate(-90deg);
}
.collapsible-content {
    transition: all 0.3s ease;
    overflow: hidden;
}
.collapsible-content.collapsed {
    display: none;
}
.question-card .question-type,
.question-card .type-options,
.question-card .question-options-row {
    transition: opacity 0.2s;
}
.question-edit-area { width:100%; margin-bottom:15px; display:flex; justify-content:flex-start; align-items:center; gap:.5rem; }
.add-feedback { position:fixed; bottom:20px; right:20px; background:#2d6a4f; color:white; padding:0.5rem 1rem; border-radius:2rem; z-index:9999; }
.question-setting { display: none; margin-top:0.8rem; padding-top:0.8rem; border-top:1px solid #e2e8f0; flex-wrap:wrap; gap:1rem; align-items:center; }

/* SURVEY PAGE QUESTION */
.question-text { font-size:1.2rem; line-height:1.5rem; font-weight:500; margin-bottom:3px; }
.question-area { margin:1rem 0 .4rem 0; background:rgba(0,0,0, .08); padding:.7rem; border-radius:8px; }
span.required { font-size:.8rem; line-height:1rem; color:#e63946; margin:0; }

/* PROGRESS BAR */
.progress-bar { background: #FFFFFF; border-radius: 1rem; height: 5px; margin-top:.8rem; margin-bottom: 1rem; overflow: hidden; }
.progress-fill { background: #2d6a4f; height: 5px; border-radius: 1rem; width: <?= $progressPercent ?>%; transition: width 0.3s; }
.progress-info { display: flex; justify-content: space-between; margin-top: -0.75rem; margin-bottom: 1rem; }
.progress-info span { font-size: 0.7rem; color: #666; }
.group-badge {
    background: rgba(45,106,79,0.1);
    color: #2d6a4f;
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: .2rem;
}
.group-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d6a4f;
    margin-bottom: 0.3rem;
}
.group-description {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 1rem;
}
.btn-icon { background:none; border:none; cursor:pointer; font-size:.9rem; color:#2d6a4f; }
.btn-nav { padding: 0.7rem 1.5rem; border-radius: 2rem; border: none; font-weight: 600; cursor: pointer; }
.btn-next { background: var(--button-bg) !important; color: var(--text-color) !important; }
.btn-prev { background: white; border: 1px solid #cbdde9; }
.option-item { margin: 0.8rem 0; display: flex; align-items: center; gap: 0.5rem; }
.star-rating { display: flex; gap: 0.5rem; font-size: 2rem; cursor: pointer; }
.star-rating i { color: #ddd; transition: 0.1s; }
.star-rating i.fa-solid { color: #ffc107; }
.matrix-table { border-collapse: collapse; width: 100%; }
.matrix-table th, .matrix-table td { border: 1px solid #ddd; padding: 8px; text-align: center; }
.matrix-table th { background: #f1f5f9; }
.image-options { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 1rem; }
.image-option { cursor: pointer; text-align: center; }
.image-option img { width: 150px; height: 150px; object-fit: cover; border-radius: 1rem; border: 3px solid transparent; transition: 0.2s; }
.image-option.selected img { border-color: #2d6a4f; box-shadow: 0 4px 12px rgba(45,106,79,0.3); }
.image-option:hover img { transform: scale(1.02); }
.error {
    background: #fde5e8;
    color: #b91c1c;
    padding: 0.8rem;
    border-radius: 2rem;
    margin-bottom: 1rem;
}
.success {
    background: #e0f2e9;
    color: #1e5a3a;
    padding: 0.8rem;
    border-radius: 2rem;
    margin-bottom: 1rem;
}
.auth-card {
    max-width: 480px;
    width: 100%;
    background: rgba(255,255,255,0.96);
    border-radius: 2.5rem;
    padding: 2rem;
    margin: auto;
    box-shadow: 0 25px 45px -12px rgba(0,0,0,0.25);
}
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
}
.tab-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0.5rem 0;
    cursor: pointer;
    color: #6c757d;
}
.tab-btn.active {
    color: #2d6a4f;
    border-bottom: 3px solid #2d6a4f;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}
.stat-card {
    background: #f9fbfd;
    border-radius: 1.2rem;
    padding: 1.2rem;
    border-left: 4px solid #2d6a4f;
}
.option-bar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0.5rem 0;
}
.bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}
.bar-fill {
    background: #2d6a4f;
    height: 100%;
    width: 0%;
}
.response-table {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
th {
    background: #f1f5f9;
}
.bg-preview .has-link {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 9px;
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
}
/* Drag-and-drop styles */
.group-card.ui-sortable-helper, .question-card.ui-sortable-helper {
    opacity: 0.8;
    transform: rotate(1deg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    cursor: grabbing !important;
}
.group-card.ui-sortable-placeholder, .question-card.ui-sortable-placeholder {
    background: #e8f0fe;
    border: 2px dashed #2d6a4f;
    border-radius: 1.5rem;
    margin-bottom: 1rem;
    height: 80px;
    visibility: visible !important;
}
.drag-handle {
    cursor: grab;
    color: #999;
    margin-right: 0.5rem;
    font-size: 1.1rem;
}
.drag-handle:active {
    cursor: grabbing;
}
.group-header .drag-handle, .question-header .drag-handle {
    display: inline-block;
}
/* Option drag-and-drop styles */
/*.option-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
    background: white;
    padding: 0.5rem;
    border-radius: 0.8rem;
    border: 1px solid #e2e8f0;
}*/
.option-drag-handle {
    cursor: grab;
    color: #999;
    font-size: 1rem;
}
.option-drag-handle:active {
    cursor: grabbing;
}
.option-item.ui-sortable-helper {
    opacity: 0.8;
    transform: rotate(1deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.option-item.ui-sortable-placeholder {
    background: #e8f0fe;
    border: 2px dashed #2d6a4f;
    border-radius: 0.8rem;
    visibility: visible !important;
    height: 45px;
}
.nav-links { display:flex; justify-content:center; align-items:center; gap:1rem; }

/* Fullscreen slideshow */
        .slideshow-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 0;
            overflow: hidden;
        }
        .slide {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-size: cover;
            background-position: center;
            opacity: 0;
            transition: opacity 1s ease-in-out;
        }
        .slide.active { opacity: 1; z-index: 1; }
        .slideshow-container.slide-effect .slide {
            transition: transform 0.8s ease-in-out, opacity 0.8s;
            transform: translateX(100%);
        }
        .slideshow-container.slide-effect .slide.active {
            transform: translateX(0);
            opacity: 1;
        }
        .slideshow-container.slide-effect .slide.prev { transform: translateX(-100%); }
        .slideshow-controls {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 20;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(8px);
            border-radius: 40px;
            padding: 8px 16px;
            display: flex;
            gap: 12px;
            color: white;
            font-size: 1.2rem;
        }
        .slideshow-controls button, .slideshow-controls .dot {
            background: none;
            border: none;
            color: white;
            cursor: pointer;
            font-size: 1.2rem;
        }
        .slideshow-controls button:hover, .slideshow-controls .dot:hover { color: #ffc107; }
        .slideshow-controls .dots { display: flex; gap: 8px; align-items: center; }
        .slideshow-controls .dot {
            width: 8px;
            height: 8px;
            background: rgba(255,255,255,0.5);
            border-radius: 50%;
            padding: 0;
        }
        .slideshow-controls .dot.active { background: white; transform: scale(1.3); }
/* Centered card – perfect vertical and horizontal centering */
        .centered-card {
            position: absolute;
            top: 50%;
            left: 10%;
            transform: translate(-10%, -50%);
            z-index: 10;
            width: 90%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
            background: rgba(255,255,255,0.85);
            backdrop-filter: blur(16px);
            border-radius: 1.5rem;
            padding: 2rem;
            box-shadow: 0 25px 45px rgba(0,0,0,0.3);
        }
        /* Custom scrollbar inside card (optional) */
        .centered-card::-webkit-scrollbar { width: 6px; }
        .centered-card::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 3px; }
        .centered-card::-webkit-scrollbar-thumb { background: #2d6a4f; border-radius: 3px; }

        .form-group { margin-bottom: .7rem; }
        .error { background:#fde5e8; color:#b91c1c; padding:0.8rem; border-radius:1rem; margin-bottom:1rem; }
        .unique-hint { font-size: 0.75rem; color: #2d6a4f; margin-top: 0.2rem; }
        .warning { background:#fff3e0; color:#b85c00; padding:1rem; border-radius:1rem; margin-bottom:1rem; text-align:center; }

        /* Sticky Save Button Bar */
        .sticky-save-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-top: 1px solid #e2e8f0;
            padding: 1rem 2rem;
            display: flex;
            justify-content: center;
            gap: 2rem;
            align-items: center;
            z-index: 1000;
            box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
            transition: transform 0.3s ease;
        }

        .sticky-save-bar.hidden {
            transform: translateY(100%);
        }

        .sticky-save-bar .save-info {
            display: flex;
            gap: .6rem;
            align-items: center;
            font-size: 0.85rem;
            color: #4a627a;
        }

        .sticky-save-bar .save-info span {
            background: #e0f2e9;
            padding: 0.2rem 0.6rem;
            border-radius: 1rem;
            color: #1e5a3a;
            margin-right:.2rem;
        }

        .sticky-save-bar .btn-primary {
            margin: 0;
            padding: 0.7rem 2rem;
            font-size: 1rem;
            max-width:450px;
        }

        /* Add padding at bottom of container to prevent content from being hidden behind sticky bar */
        .builder-container {
            max-width: 1000px; margin:0 auto; background:white; border-radius:2rem; padding:2rem; box-shadow:0 20px 35px -10px rgba(0,0,0,0.1);
            padding-bottom: 90px;
        }

        /* Question settings panel */
        .question-settings {
            margin-top: 0.8rem;
            padding-top: 0.8rem;
            border-top: 1px solid #e2e8f0;
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            align-items: center;
        }

        .setting-item {
            display: flex;
            align-items: center;
            gap: 0.2rem;
            font-size: 0.8rem;
        }

        .setting-item input[type="number"] {
            width: 70px;
            padding: 0.3rem;
        }

        .setting-item label {
            display: inline;
            margin: 0;
            font-weight: normal;
        }
        .setting-item label:has(input[type="radio"]), .setting-item label:has(input[type="checkbox"]) { white-space:nowrap; }
        .setting-item span.info { font-size:0.7rem; color:#666; white-space:nowrap; font-style:italic; }

        @media (max-width: 768px) {
            .sticky-save-bar {
                flex-direction: column;
                gap: 0.8rem;
                padding: 0.8rem 1rem;
            }
            .builder-container {
                padding-bottom: 120px;
            }
        }
