/* ── Base ── */
body { background: #f5f6fa; }

.hero {
    background: linear-gradient(90deg, #4c3aff, #7b5cff);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.card { height: 100%; border-radius: 12px; }
.card-body { display: flex; flex-direction: column; }
.card-body p { flex-grow: 1; }

.footer {
    background: #222;
    color: white;
    padding: 30px 0;
    text-align: center;
    margin-top: 50px;
}

/* ── Shared Slide Panel ── */
.slide-panel {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 380px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(76, 58, 255, 0.18);
    z-index: 1060;
    padding: 28px 26px 22px 26px;
    display: none;
    animation: slideUp 0.3s ease;
    max-height: 92vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to   { opacity: 1; transform: translateY(0); }
}

.slide-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.slide-panel .panel-header h6 {
    margin: 0;
    font-weight: 700;
    color: #4c3aff;
    font-size: 1.1rem;
}

.slide-panel .close-panel {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}
.slide-panel .close-panel:hover { color: #333; }

/* Divider with text */
.panel-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    color: #aaa;
    font-size: 0.8rem;
}
.panel-divider::before,
.panel-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

/* Switch link row */
.panel-switch {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: 12px;
}
.panel-switch a {
    color: #4c3aff;
    font-weight: 600;
    text-decoration: none;
}
.panel-switch a:hover { text-decoration: underline; }

/* Overlay */
#slidePanelOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.22);
    z-index: 1055;
    backdrop-filter: blur(2px);
}

/* Input focus accent */
.slide-panel .form-control:focus,
.slide-panel .form-select:focus {
    border-color: #7b5cff;
    box-shadow: 0 0 0 0.2rem rgba(123, 92, 255, 0.15);
}

/* Auto-password info box */
.auto-password-info {
    background: linear-gradient(135deg, #f0eeff, #e8f5e9);
    border: 1px solid #c5b8ff;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.82rem;
    color: #4c3aff;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.auto-password-info .icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* Phone input group */
.phone-prefix {
    background: #f0eeff;
    border: 1px solid #ced4da;
    border-right: none;
    border-radius: 6px 0 0 6px;
    padding: 0 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4c3aff;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* ID type toggle buttons */
.id-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.id-toggle label {
    flex: 1;
    text-align: center;
    padding: 7px 6px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    user-select: none;
}
.id-toggle input[type="radio"] { display: none; }
.id-toggle input[type="radio"]:checked + label {
    border-color: #4c3aff;
    background: #f0eeff;
    color: #4c3aff;
}

/* ── Horizontal Scroll Card Row ── */
.horizontal-scroll-wrapper {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #7b5cff #f0eeff;
}

.horizontal-scroll-wrapper::-webkit-scrollbar {
    height: 6px;
}

.horizontal-scroll-wrapper::-webkit-scrollbar-track {
    background: #f0eeff;
    border-radius: 10px;
}

.horizontal-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #7b5cff;
    border-radius: 10px;
}

.scroll-card {
    flex: 0 0 300px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
}

/* Inner description scroll for very long text */
.card-text-scroll {
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f9f9f9;
}

.card-text-scroll::-webkit-scrollbar {
    width: 4px;
}

.card-text-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* Make cards full-width only when there's just one */
.horizontal-scroll-wrapper:has(.scroll-card:only-child) .scroll-card {
    flex: 0 0 100%;
}

/* ── Card Action Buttons Row ── */
.card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

/* ── View Icon Button ── */
.btn-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: #f0eeff;
    border: 1.5px solid #c5b8ff;
    color: #4c3aff;
    border-radius: 8px;
    padding: 5px 13px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    white-space: nowrap;
}
.btn-view:hover {
    background: #4c3aff;
    color: #fff;
    border-color: #4c3aff;
}
.btn-view svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ── Active card highlight ── */
.scroll-card .card.card-active {
    border: 2px solid #4c3aff;
    box-shadow: 0 0 0 3px rgba(76,58,255,0.12);
}

/* ── Detail View Box ── */
.detail-view-box {
    display: none;
    width: 100%;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(76, 58, 255, 0.13);
    border: 1.5px solid #e0d8ff;
    margin-top: 18px;
    overflow: hidden;
    animation: expandDown 0.28s cubic-bezier(.4,0,.2,1);
}

@keyframes expandDown {
    from { opacity: 0; transform: translateY(-14px) scaleY(0.95); }
    to   { opacity: 1; transform: translateY(0) scaleY(1); }
}

.detail-view-box.box-warning {
    border-color: #ffc107;
    box-shadow: 0 8px 32px rgba(255, 193, 7, 0.13);
}

/* Header stripe */
.detail-header {
    background: linear-gradient(90deg, #4c3aff 0%, #7b5cff 100%);
    color: #fff;
    padding: 18px 24px 14px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.detail-header.header-warning {
    background: linear-gradient(90deg, #e6a800 0%, #ffc107 100%);
    color: #222;
}

.detail-header h5 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.detail-header .detail-badge {
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    padding: 3px 11px;
    background: rgba(255,255,255,0.22);
    color: inherit;
    display: inline-block;
    margin-top: 2px;
}

.detail-close-btn {
    background: rgba(255,255,255,0.18);
    border: none;
    border-radius: 8px;
    color: inherit;
    font-size: 1.1rem;
    line-height: 1;
    padding: 4px 9px;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.detail-close-btn:hover { background: rgba(255,255,255,0.38); }

/* Body */
.detail-body {
    padding: 20px 24px 22px 24px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-bottom: 16px;
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #555;
}

.detail-meta-item svg {
    width: 15px;
    height: 15px;
    color: #7b5cff;
    flex-shrink: 0;
}

.detail-meta-item.warning-icon svg { color: #e6a800; }

.detail-desc-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #aaa;
    margin-bottom: 6px;
}

.detail-desc-content {
    font-size: 0.92rem;
    color: #333;
    line-height: 1.65;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f9f9f9;
}

.detail-desc-content::-webkit-scrollbar { width: 4px; }
.detail-desc-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.detail-footer {
    padding: 14px 24px 18px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* Pointer arrow above the detail box */
.detail-arrow {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid #e0d8ff;
    margin-left: 28px;
    margin-top: 10px;
    display: none;
}
.detail-arrow.arrow-warning {
    border-bottom-color: #ffc107;
}
.detail-arrow-inner {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #fff;
    margin-left: -10px;
    margin-top: 2px;
}

/* ----- GLOBAL RESPONSIVE RESET ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f4f7fc;
    font-family: system-ui, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    line-height: 1.5;
}

/* container fluid inner spacing */
.container {
    padding-left: clamp(1rem, 5vw, 3rem);
    padding-right: clamp(1rem, 5vw, 3rem);
}

/* section title */
.section-title {
    font-size: clamp(1.8rem, 6vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* service type heading */
.service-type-heading {
    border-left: 5px solid #0d6efd;
    padding-left: 1rem;
    font-weight: 700;
    font-size: clamp(1.25rem, 4vw, 1.6rem);
    margin-bottom: 1.75rem;
    color: #0a2b44;
}

/* ----- CARD STYLES (FULLY RESPONSIVE) ----- */
.service-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border-radius: 1.25rem;
    background: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    height: 100%;  /* ensures equal height in row */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: none;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.15);
}

/* responsive media container (image/video) with fixed aspect ratio 16:9 */
.card-media-wrapper {
    position: relative;
    width: 100%;
    background: #eef2f5;
    aspect-ratio: 16 / 9;   /* modern responsive height control */
    overflow: hidden;
}

.card-img-top, 
.card-video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: 0.2s;
    display: block;
}

.card-img-top:hover,
.card-video-preview:hover {
    transform: scale(1.02);
}

/* placeholder when no media */
.media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    font-size: 0.9rem;
}

/* card body flexible content */
.card-body {
    padding: 1.25rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.service-title {
    font-weight: 700;
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    margin-bottom: 0.6rem;
    color: #0f172a;
    line-height: 1.4;
}

.service-description {
    color: #334155;
    font-size: 0.875rem;
    line-height: 1.5;
    flex-grow: 1;
}

.read-more-btn {
    background: none;
    border: none;
    color: #0d6efd;
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.3rem 0;
    margin-top: 0.75rem;
    align-self: flex-start;
    transition: 0.2s;
    cursor: pointer;
}

.read-more-btn:hover {
    color: #004cba;
    text-decoration: underline;
}

/* ----- RESPONSIVE MODAL (images/videos) ----- */
.modal-media {
    width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 16px;
}

.modal-content.bg-custom {
    background: transparent;
    border: none;
}

.modal-body-custom {
    background: rgba(0,0,0,0.85);
    border-radius: 28px;
    padding: 0.5rem;
}

.btn-close-white-custom {
    filter: invert(1);
    opacity: 0.8;
}

/* extra small devices */
@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }
    .service-description {
        font-size: 0.8rem;
    }
}

/* ensure grid gap is consistent */
.row.g-4 {
    --bs-gutter-y: 1.5rem;
}

@media (min-width: 992px) {
    .navbar .dropdown:hover > .dropdown-menu {
        display: block !important;
        opacity: 1;
        visibility: visible;
    }

    .dropdown-menu {
        margin-top: 0;
    }
}

.dropdown-menu {
    display: none;
    transition: all 0.2s ease;
}