/* ============================================================
   HostPanel — Main Stylesheet
   Bootstrap 5 base + Plesk-style UI theme
   ============================================================ */

:root {
    --hp-sidebar-bg:    #1c2030;
    --hp-sidebar-hover: #252c42;
    --hp-sidebar-active:#2d78c8;
    --hp-topbar-bg:     #1c2030;
    --hp-topbar-height: 52px;
    --hp-sidebar-width: 220px;
    --hp-accent:        #2d78c8;
    --hp-accent-light:  #3d8ee0;
    --hp-text-muted:    #8a9bb5;
    --hp-border:        #e8ecf0;
    --hp-card-shadow:   0 1px 4px rgba(0,0,0,.08);
    --hp-content-bg:    #f4f6f9;
}

/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: .9rem;
    background: var(--hp-content-bg);
    color: #2c3e50;
    overflow-x: hidden;
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.hp-topbar {
    background: var(--hp-topbar-bg);
    height: var(--hp-topbar-height);
    border-bottom: 1px solid rgba(255,255,255,.06);
    z-index: 1040;
    padding: 0 .75rem;
}

.hp-logo .logo-text {
    font-size: 1.35rem;
    font-weight: 300;
    color: #fff;
    letter-spacing: -0.5px;
}
.hp-logo .logo-text strong {
    font-weight: 700;
    color: #4da6ff;
}

.hp-sidebar-toggle { border: none; background: transparent; }
.hp-sidebar-toggle:hover { opacity:.75; }

.hp-search-wrap { position: relative; width: 340px; }
.hp-search-icon { background: #252c42; border: 1px solid #3a4260; color: #8a9bb5; }
.hp-search-input {
    background: #252c42;
    border: 1px solid #3a4260;
    color: #fff;
    font-size: .85rem;
}
.hp-search-input:focus {
    background: #2a3350;
    border-color: var(--hp-accent);
    color: #fff;
    box-shadow: none;
}
.hp-search-input::placeholder { color: #6b7fa0; }
.hp-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--hp-border);
    border-radius: .375rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    z-index: 1050;
    display: none;
    max-height: 320px;
    overflow-y: auto;
}
.hp-search-result-item {
    padding: .5rem .875rem;
    cursor: pointer;
    border-bottom: 1px solid var(--hp-border);
    font-size: .85rem;
}
.hp-search-result-item:hover { background: #f0f4ff; }

.hp-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--hp-accent);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.hp-sidebar {
    position: fixed;
    top: var(--hp-topbar-height);
    left: 0;
    bottom: 0;
    width: var(--hp-sidebar-width);
    background: var(--hp-sidebar-bg);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1030;
    transition: transform .25s ease;
    scrollbar-width: thin;
    scrollbar-color: #3a4260 transparent;
}

.hp-sidebar.collapsed { transform: translateX(-100%); }

.hp-sidebar-inner { padding-bottom: 80px; }

.hp-nav-section { border-bottom: 1px solid rgba(255,255,255,.06); }

.hp-nav-section-header {
    width: 100%;
    padding: .7rem 1rem;
    background: transparent;
    border: none;
    color: #7a8faa;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .7px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color .15s;
}
.hp-nav-section-header:hover { color: #b0c0d6; }
.hp-nav-section-header .hp-chevron {
    transition: transform .25s;
    font-size: .7rem;
}
.hp-nav-section-header:not(.collapsed) .hp-chevron { transform: rotate(180deg); }

.hp-nav-list {
    list-style: none;
    padding: 0 0 .5rem 0;
    margin: 0;
}

.hp-nav-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem 1rem .45rem 1.75rem;
    color: #99afc8;
    text-decoration: none;
    font-size: .84rem;
    border-radius: 0;
    transition: background .15s, color .15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hp-nav-link i { font-size: .95rem; min-width: 16px; }
.hp-nav-link:hover  { background: var(--hp-sidebar-hover); color: #d0e0f5; }
.hp-nav-link.active { background: var(--hp-sidebar-active); color: #fff; font-weight: 500; }

.hp-sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: .75rem 1rem;
    background: rgba(0,0,0,.2);
    border-top: 1px solid rgba(255,255,255,.06);
}

/* ── Main Content ────────────────────────────────────────────────────────── */
.hp-main {
    margin-left: var(--hp-sidebar-width);
    margin-top: var(--hp-topbar-height);
    min-height: calc(100vh - var(--hp-topbar-height));
    transition: margin-left .25s ease;
}
.hp-main.expanded { margin-left: 0; }

.hp-breadcrumb {
    padding: .6rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--hp-border);
    font-size: .83rem;
}
.hp-breadcrumb .breadcrumb { margin: 0; }
.hp-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: #aab; }
.hp-breadcrumb a { color: var(--hp-accent); text-decoration: none; }
.hp-breadcrumb a:hover { text-decoration: underline; }

.hp-content { padding: 1.5rem; }

/* ── Domain Cards (Plesk-style) ──────────────────────────────────────────── */
.hp-domain-card {
    background: #fff;
    border: 1px solid var(--hp-border);
    border-radius: .5rem;
    box-shadow: var(--hp-card-shadow);
    transition: box-shadow .2s, border-color .2s;
    overflow: hidden;
}
.hp-domain-card:hover {
    box-shadow: 0 4px 16px rgba(45,120,200,.12);
    border-color: #c0d4f0;
}

.hp-domain-card-header {
    background: #f8fafd;
    border-bottom: 1px solid var(--hp-border);
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.hp-domain-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--hp-accent);
    text-decoration: none;
}
.hp-domain-name:hover { text-decoration: underline; color: var(--hp-accent-light); }

.hp-domain-card-body { padding: .75rem 1rem; }

.hp-domain-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .75rem;
    font-size: .78rem;
    color: #6b7a90;
    margin-bottom: .75rem;
}
.hp-domain-meta i { color: #aab; }

/* Action icons grid (the Plesk-style feature grid) */
.hp-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .4rem;
}
.hp-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    padding: .55rem .25rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: .35rem;
    text-decoration: none;
    color: var(--hp-accent);
    font-size: .72rem;
    text-align: center;
    transition: background .15s, border-color .15s;
    cursor: pointer;
}
.hp-action-btn i { font-size: 1.1rem; }
.hp-action-btn:hover {
    background: #eef4fd;
    border-color: #c8ddf7;
    color: var(--hp-accent-light);
}
.hp-action-btn.text-danger:hover { background: #fff0f0; border-color: #fcc; }

/* ── Page Header ─────────────────────────────────────────────────────────── */
.hp-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.hp-page-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #1e2a3a;
    margin: 0;
}
.hp-page-title span { color: var(--hp-accent); }

/* ── Stats Widgets ───────────────────────────────────────────────────────── */
.hp-stat-card {
    background: #fff;
    border: 1px solid var(--hp-border);
    border-radius: .5rem;
    padding: 1.1rem 1.25rem;
    box-shadow: var(--hp-card-shadow);
}
.hp-stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: .4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.hp-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.hp-stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    color: #1e2a3a;
}
.hp-stat-card .stat-label {
    font-size: .78rem;
    color: #7a8a9a;
    margin-top: .2rem;
}

/* Resource bars */
.hp-resource-bar .bar-label {
    font-size: .8rem;
    color: #6b7a90;
    margin-bottom: .25rem;
}
.hp-resource-bar .bar-percent {
    font-size: .8rem;
    font-weight: 600;
    color: #1e2a3a;
}

/* ── Service Health Badges ───────────────────────────────────────────────── */
.hp-service-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    padding: .2rem .55rem;
    border-radius: 2rem;
    font-weight: 500;
}
.hp-service-badge.online  { background: #e8f5e9; color: #2e7d32; }
.hp-service-badge.offline { background: #fff3e0; color: #e65100; }

/* ── Wizard Layout ───────────────────────────────────────────────────────── */
.hp-wizard-wrap {
    min-height: 100vh;
    background: linear-gradient(135deg, #1c2030 0%, #2a3a5c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.hp-wizard-card {
    background: #fff;
    border-radius: .75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    width: 100%;
    max-width: 520px;
    overflow: hidden;
}
.hp-wizard-header {
    background: var(--hp-topbar-bg);
    padding: 1.75rem 2rem;
    text-align: center;
}
.hp-wizard-header .wizard-logo {
    font-size: 1.8rem;
    font-weight: 300;
    color: #fff;
}
.hp-wizard-header .wizard-logo strong { font-weight: 700; color: #4da6ff; }
.hp-wizard-header p { color: #8a9bb5; font-size: .88rem; margin: .5rem 0 0; }
.hp-wizard-body { padding: 2rem; }
.hp-wizard-steps {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--hp-border);
}
.hp-wizard-step {
    flex: 1;
    text-align: center;
    padding: .5rem;
    font-size: .78rem;
    color: #aab;
    position: relative;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.hp-wizard-step.active { color: var(--hp-accent); border-bottom-color: var(--hp-accent); font-weight: 600; }
.hp-wizard-step.done   { color: #4caf50; }
.hp-wizard-step-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

/* ── Login Page ──────────────────────────────────────────────────────────── */
.hp-login-wrap {
    min-height: 100vh;
    background: linear-gradient(135deg, #1c2030 0%, #2a3a5c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.hp-login-card {
    background: #fff;
    border-radius: .75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}
.hp-login-header {
    background: var(--hp-topbar-bg);
    padding: 2rem;
    text-align: center;
}
.hp-login-logo {
    font-size: 2rem;
    font-weight: 300;
    color: #fff;
}
.hp-login-logo strong { font-weight: 800; color: #4da6ff; }
.hp-login-body { padding: 2rem; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.hp-table { width: 100%; }
.hp-table th {
    background: #f8fafd;
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6b7a90;
    padding: .65rem 1rem;
    border-bottom: 2px solid var(--hp-border);
    white-space: nowrap;
}
.hp-table td {
    padding: .65rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #edf0f4;
    font-size: .87rem;
}
.hp-table tr:last-child td { border-bottom: none; }
.hp-table tr:hover td { background: #f9fbfd; }

/* ── Misc Utilities ──────────────────────────────────────────────────────── */
.text-hp-blue { color: var(--hp-accent); }
.bg-hp-dark   { background: var(--hp-sidebar-bg); }

/* Responsive */
@media (max-width: 768px) {
    .hp-sidebar { transform: translateX(-100%); }
    .hp-sidebar.mobile-open { transform: translateX(0); }
    .hp-main { margin-left: 0; }
    .hp-actions-grid { grid-template-columns: repeat(2, 1fr); }
}
