/* KNWS Hosting Portal Styles */

:root {
    --knws-primary: #0d6efd;
    --knws-dark: #1a1d23;
    --knws-accent: #00b4d8;
    --knws-gradient-start: #1a1d23;
    --knws-gradient-end: #2d3748;
    --sidebar-width: 220px;
}

/* Layout */
html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* Auth Layout */
.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--knws-gradient-start) 0%, #2d3748 50%, var(--knws-accent) 100%);
    padding: 2rem 0;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 2rem;
}

/* Navbar */
.portal-header {
    background: linear-gradient(135deg, var(--knws-gradient-start) 0%, var(--knws-gradient-end) 100%);
}

.portal-header .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.portal-header .nav-link:hover {
    color: #fff;
}

.portal-header .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.portal-header .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.portal-header .dropdown-toggle::after {
    color: rgba(255, 255, 255, 0.85);
}

/* Sidebar */
#wrapper {
    min-height: calc(100vh - 56px - 52px); /* viewport - navbar - footer */
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid #e2e8f0;
    padding-top: 0.5rem;
}

.sidebar .nav-link {
    color: #495057;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
}

.sidebar .nav-link:hover {
    background: #f0f4f8;
    color: var(--knws-primary);
}

.sidebar .nav-link.active {
    background: #e8f0fe;
    color: var(--knws-primary);
    font-weight: 600;
}

.sidebar .nav-link i {
    width: 1.2em;
    text-align: center;
    font-size: 1rem;
}

.sidebar .nav-link .badge {
    font-size: 0.65rem;
}

.sidebar-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #868e96;
    padding: 1rem 1rem 0.3rem;
    font-weight: 700;
    list-style: none;
}

#page-content-wrapper {
    min-width: 0;
    overflow-x: auto;
}

/* Server Status Badges */
.badge.bg-provisioning { background-color: #17a2b8 !important; }
.badge.bg-running { background-color: #28a745 !important; }
.badge.bg-stopped { background-color: #6c757d !important; }
.badge.bg-suspended { background-color: #ffc107 !important; color: #000 !important; }
.badge.bg-destroying { background-color: #dc3545 !important; }
.badge.bg-destroyed { background-color: #343a40 !important; }

/* Server Cards */
.server-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e2e8f0;
}

.server-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Cards */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-card {
        padding: 1.5rem;
        margin: 0 1rem;
    }

    .auth-layout {
        padding: 1rem 0;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    #wrapper {
        flex-direction: column;
    }
}
