/* =====================================================================
   Cloud India Hub — Global UI Enhancement Layer
   Loaded LAST in frontend.layout.app so it lifts every page at once.
   Purely additive: shadows, radius, hover micro-interactions, brand
   focus rings, smooth scroll-reveal. Safe to remove (1 file + 2 lines).
   Brand red: #c5181d
   ===================================================================== */

:root {
    --ce-primary: #c5181d;
    --ce-primary-dark: #a01015;
    --ce-primary-soft: #f8e7e8;
    --ce-ink: #1f2430;
    --ce-muted: #6b7280;
    --ce-radius: 14px;
    --ce-radius-sm: 10px;
    --ce-ease: cubic-bezier(.22, .61, .36, 1);
    --ce-shadow-sm: 0 2px 8px rgba(17, 17, 26, .05), 0 1px 3px rgba(17, 17, 26, .06);
    --ce-shadow-md: 0 8px 24px rgba(17, 17, 26, .08), 0 3px 8px rgba(17, 17, 26, .05);
    --ce-shadow-lg: 0 18px 48px rgba(17, 17, 26, .12);
}

/* ---------- 1. Typography polish ---------- */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
    letter-spacing: -.01em;
}

/* ---------- 2. Smooth scroll + fixed-header offset ---------- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 95px;
}

::selection {
    background: var(--ce-primary);
    color: #fff;
}

/* ---------- 3. Branded slim scrollbar ---------- */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--ce-primary) transparent;
}
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--ce-primary), var(--ce-primary-dark));
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--ce-primary-dark); background-clip: content-box; }

/* ---------- 4. Link transitions ---------- */
a { transition: color .2s var(--ce-ease), opacity .2s var(--ce-ease); }

/* ---------- 5. Card polish ---------- */
.card {
    border: 1px solid #eef0f4;
    border-radius: var(--ce-radius);
    box-shadow: var(--ce-shadow-sm);
    transition: transform .35s var(--ce-ease), box-shadow .35s var(--ce-ease);
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ce-shadow-md);
}

/* ---------- 6. Button micro-interactions (additive only) ---------- */
.btn,
button.search-btn11,
.hero-btn,
.book-now-btn,
.idx-vps-cta-btn,
.billing-btn,
.wa-start,
.login-btn,
input[type="submit"] {
    transition: transform .25s var(--ce-ease),
        box-shadow .25s var(--ce-ease),
        filter .25s var(--ce-ease),
        background-color .25s var(--ce-ease) !important;
    will-change: transform;
}
.btn:hover,
button.search-btn11:hover,
.hero-btn:hover,
.book-now-btn:hover,
.idx-vps-cta-btn:hover,
.wa-start:hover,
.login-btn:hover,
input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--ce-shadow-md);
    filter: brightness(1.04);
}
.btn:active,
.hero-btn:active,
.book-now-btn:active,
.idx-vps-cta-btn:active { transform: translateY(0); }

/* Bring Bootstrap primary buttons onto the brand (red gradient) */
.btn-primary,
.btn-primary:focus {
    background: linear-gradient(135deg, #e3262c 0%, var(--ce-primary) 60%, var(--ce-primary-dark) 100%);
    border: none;
    color: #fff;
    box-shadow: 0 6px 16px rgba(197, 24, 29, .22);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--ce-primary) 0%, var(--ce-primary-dark) 100%);
    color: #fff;
}

/* ---------- 7. Form focus rings in brand color ---------- */
.form-control,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="tel"],
textarea, select {
    transition: border-color .2s var(--ce-ease), box-shadow .2s var(--ce-ease);
}
.form-control:focus,
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus,
input[type="number"]:focus, input[type="search"]:focus, input[type="tel"]:focus,
textarea:focus, select:focus {
    border-color: var(--ce-primary) !important;
    box-shadow: 0 0 0 .2rem rgba(197, 24, 29, .15) !important;
    outline: none;
}

/* ---------- 8. Tables ---------- */
.table thead th {
    background: var(--ce-primary-soft);
    color: var(--ce-primary-dark);
    border-bottom: 2px solid rgba(197, 24, 29, .18);
    font-weight: 600;
}
.table tbody tr { transition: background-color .18s var(--ce-ease); }
.table tbody tr:hover { background: #fff5f5; }

/* ---------- 9. Scroll-reveal (driven by ui-enhance.js) ---------- */
.ce-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s var(--ce-ease), transform .7s var(--ce-ease);
    will-change: opacity, transform;
}
.ce-reveal.ce-reveal-in {
    opacity: 1;
    transform: none;
}

/* ---------- 10. Back-to-top button (injected by ui-enhance.js) ---------- */
#ce-top {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 9996;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #e3262c, var(--ce-primary-dark));
    color: #fff;
    font-size: 20px;
    line-height: 46px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(197, 24, 29, .35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(.9);
    transition: opacity .3s var(--ce-ease), transform .3s var(--ce-ease), visibility .3s;
}
#ce-top.ce-show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
#ce-top:hover { transform: translateY(-3px) scale(1.06); }

/* ---------- 11. Scroll progress bar (injected by ui-enhance.js) ---------- */
#ce-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 10000;
    background: linear-gradient(90deg, #e3262c, var(--ce-primary), #ff7a3c);
    box-shadow: 0 1px 6px rgba(197, 24, 29, .45);
    transition: width .1s linear;
    pointer-events: none;
}

/* ---------- 12. Softer button radius + weight (additive) ---------- */
.btn {
    border-radius: var(--ce-radius-sm);
    font-weight: 600;
}

/* ---------- 13. Badges / pills polish ---------- */
.badge {
    border-radius: 999px;
    padding: .4em .8em;
    font-weight: 600;
    letter-spacing: .2px;
}

/* ---------- 14. Header gets a soft shadow once you scroll ---------- */
body.ce-scrolled .header-upper,
body.ce-scrolled .main-header,
body.ce-scrolled header {
    box-shadow: 0 6px 24px rgba(17, 17, 26, .10);
    transition: box-shadow .3s var(--ce-ease);
}

/* ---------- 15. Tables become horizontally scrollable on small screens
                  (wrapper injected by ui-enhance.js) ---------- */
.ce-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--ce-radius-sm);
}

/* =====================================================================
   16. MOBILE RESPONSIVENESS (additive, never hides content)
   ===================================================================== */

/* Media never overflows its container */
img, svg, video, iframe, embed, object {
    max-width: 100%;
}
img, video {
    height: auto;
}

/* Long URLs / words wrap instead of breaking layout */
p, li, td, th, span, a, h1, h2, h3, h4, h5 {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@media (max-width: 991px) {
    h1 { font-size: clamp(1.7rem, 6vw, 2.4rem); }
    h2 { font-size: clamp(1.4rem, 5vw, 2rem); }
}

@media (max-width: 768px) {
    /* Comfortable side padding so content never touches the edges */
    .container, .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Bigger, finger-friendly tap targets */
    .btn,
    .hero-btn,
    .book-now-btn,
    .idx-vps-cta-btn,
    .billing-btn,
    .login-btn,
    input[type="submit"],
    button.search-btn11 {
        min-height: 44px;
    }

    /* Keep floating helpers from stacking on top of each other */
    #ce-top { bottom: 140px; right: 16px; }
}

@media (max-width: 480px) {
    h3 { font-size: clamp(1.15rem, 5.2vw, 1.5rem); }

    /* Cards breathe a little less on tiny screens */
    .card { border-radius: var(--ce-radius-sm); }
}

/* ---------- 17. Respect reduced-motion users ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .ce-reveal { opacity: 1 !important; transform: none !important; transition: none; }
    .card, .btn, #ce-progress { transition: none; }
}
