/**
 * WHMCS Premium SaaS & Hosting Client Area Redesign Framework
 * Theme Profile: Fresh Light Green & Soft Tech Slate
 * File: custom.css (Unified Theme Overrides)
 */

/* ==========================================================================
   1. GLOBAL ARCHITECTURE & DESIGN TOKENS
   ========================================================================== */
:root {
    /* Brand Accent Spectrum */
    --primary-hsl: 142, 72%, 43%;          /* #10b981 - Tech Light Green */
    --primary: hsl(var(--primary-hsl));
    --primary-hover: hsl(142, 72%, 33%);
    --primary-light: rgba(16, 185, 129, 0.06);
    --primary-glow: rgba(16, 185, 129, 0.15);

    /* Interface Colors */
    --bg-global: #f8fafc;                  /* Soft slate-gray modern canvas */
    --bg-card: #ffffff;
    --border-color: #f1f5f9;
    --border-hover: #e2e8f0;

    /* Typography Color Spectrum */
    --text-main: #0f172a;                  /* High-contrast deep slate */
    --text-muted: #64748b;                 /* Clean supporting gray */
    --text-light: #94a3b8;

    /* Semantic Health Indicators */
    --status-success: #22c55e;
    --status-success-bg: #dcfce7;
    --status-pending: #f59e0b;
    --status-pending-bg: #fef3c7;
    --status-danger: #ef4444;
    --status-danger-bg: #fee2e2;

    /* Radii & Structural Elevations */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.02), 0 2px 4px -1px rgba(15, 23, 42, 0.02);
    --shadow-premium: 0 20px 25px -5px rgba(15, 23, 42, 0.04), 0 10px 10px -5px rgba(15, 23, 42, 0.02);
    
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Level Resets */
body {
    background-color: var(--bg-global) !important;
    color: var(--text-main) !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   2. CORE PREMIUM COMPONENT OVERRIDES
   ========================================================================== */

/* Modern SaaS Rounded Cards */
.saas-card, 
.card, 
.panel, 
.thumbnail {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-md) !important;
    transition: var(--transition-smooth) !important;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.saas-card:hover, 
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-premium) !important;
    border-color: var(--border-hover) !important;
}

/* Premium Button Architecture */
.btn-premium-primary,
.btn-primary,
.btn-success {
    background-color: var(--primary) !important;
    background-image: none !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.625rem 1.25rem !important;
    border: none !important;
    box-shadow: var(--shadow-sm) !important;
    transition: var(--transition-smooth) !important;
}
.btn-premium-primary:hover,
.btn-primary:hover,
.btn-success:hover {
    background-color: var(--primary-hover) !important;
    box-shadow: 0 4px 12px var(--primary-glow) !important;
}

/* Clean Input & Form Overrides */
.saas-form-control,
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    background-color: #ffffff !important;
    color: var(--text-main) !important;
    box-shadow: none !important;
    transition: var(--transition-smooth) !important;
    height: auto !important;
}
.saas-form-control:focus,
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-light) !important;
}

/* Responsive Table Overrides */
.table, 
.dataTables_wrapper {
    background: transparent !important;
    border: none !important;
}
.table thead th {
    background: #fafafa !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.05em !important;
    padding: 1rem 1.5rem !important;
    border-bottom: 1px solid var(--border-color) !important;
}
.table tbody td {
    padding: 1.25rem 1.5rem !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    vertical-align: middle !important;
}

/* Standardized Status Badges */
.badge,
.label {
    padding: 0.35rem 0.75rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    border-radius: 50px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    border: none !important;
}
.badge-success, .status-active, .status-paid { 
    background-color: var(--status-success-bg) !important; color: var(--status-success) !important; 
}
.badge-warning, .status-pending { 
    background-color: var(--status-pending-bg) !important; color: var(--status-pending) !important; 
}
.badge-danger, .status-unpaid, .status-terminated { 
    background-color: var(--status-danger-bg) !important; color: var(--status-danger) !important; 
}

/* ==========================================================================
   3. SYSTEM APP PAGES DESIGN (AUTHENTICATION & LAYOUT)
   ========================================================================== */

/* Split Screen Login/Registration Wrapper */
.saas-auth-split {
    display: flex;
    min-height: 100vh;
    background: #ffffff;
}
.saas-auth-sidebar {
    flex: 1;
    background: linear-gradient(135deg, #064e3b 0%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    color: #ffffff;
}
.saas-auth-form-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 2rem;
}

/* Navigation Layout Overhauls */
.navbar-main, .header-nav {
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
}
.sidebar-nav .list-group-item {
    border: none !important;
    border-radius: var(--radius-sm) !important;
    margin-bottom: 0.25rem !important;
    color: var(--text-muted) !important;
    transition: var(--transition-smooth) !important;
}
.sidebar-nav .list-group-item.active,
.sidebar-nav .list-group-item:hover {
    background-color: var(--primary-light) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   4. SALES, INFRASTRUCTURE & DOMAIN OVERFLOW
   ========================================================================== */

/* Premium Hosting Pricing Matrix Layout */
.saas-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}
.saas-pricing-card-featured {
    border: 2px solid var(--primary) !important;
    box-shadow: var(--shadow-premium) !important;
    position: relative;
}
.saas-pricing-card-featured::before {
    content: "POPULAR PLAN";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 1rem;
    border-radius: 50px;
    letter-spacing: 0.05em;
}

/* Domain Search Portal Hero Layout */
.domain-search-hero {
    background: linear-gradient(180deg, #edfdf4 0%, var(--bg-global) 100%);
    padding: 5rem 1rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 3rem;
}
.domain-search-wrapper {
    background: #ffffff;
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    display: flex;
    align-items: center;
    max-width: 700px;
    margin: 0 auto;
}
.domain-search-wrapper input {
    border: none !important;
    box-shadow: none !important;
    font-size: 1.125rem !important;
}

/* ==========================================================================
   5. HELP DESK (TICKET CHAT ENGINE)
   ========================================================================== */
.ticket-reply {
    border-radius: var(--radius-md) !important;
    padding: 1.25rem !important;
    margin-bottom: 1.5rem !important;
    border: 1px solid var(--border-color) !important;
}
/* Customer Message Node */
.ticket-reply.client {
    background-color: #f8fafc !important;
    margin-right: 3rem;
}
/* Support Staff Response Node */
.ticket-reply.staff {
    background-color: var(--primary-light) !important;
    border-color: rgba(16, 185, 129, 0.15) !important;
    margin-left: 3rem;
}

/* ==========================================================================
   6. RESPONSIVE LAYER ADAPTATIONS
   ========================================================================== */
@media (max-width: 991.98px) {
    .saas-auth-split {
        flex-direction: column;
    }
    .saas-auth-sidebar {
        display: none !important; /* Hide marketing rail on mobile devices */
    }
    .domain-search-wrapper {
        flex-direction: column;
        border-radius: var(--radius-md);
    }
    .domain-search-wrapper button {
        width: 100%;
        margin-top: 0.5rem;
    }
    .ticket-reply.client, 
    .ticket-reply.staff {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}