/*
 * Connect Quest Tools Portal
 * Main Stylesheet v1.0.0
 * Colors: Primary #0f9d58 | Dark #0b7a3e | Darkest #064d27
 */

/* ===========================
   CSS CUSTOM PROPERTIES
   =========================== */
:root {
    --cq-green: #0f9d58;
    --cq-green-dark: #0b7a3e;
    --cq-green-darker: #064d27;
    --cq-green-light: #e8f5e9;
    --cq-green-lightest: #f1faf4;
    --cq-green-hover: #0d8a4c;
    
    --cq-dark: #0d1117;
    --cq-dark-secondary: #161b22;
    --cq-dark-tertiary: #21262d;
    --cq-dark-border: #30363d;
    
    --cq-text: #1a1a2e;
    --cq-text-muted: #6b7280;
    --cq-text-light: #9ca3af;
    
    --cq-bg: #f8fafb;
    --cq-bg-card: #ffffff;
    --cq-border: #e5e7eb;
    --cq-border-light: #f3f4f6;
    
    --cq-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --cq-font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    
    --cq-radius: 10px;
    --cq-radius-sm: 6px;
    --cq-radius-lg: 16px;
    --cq-radius-xl: 24px;
    
    --cq-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
    --cq-shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 8px 32px rgba(0,0,0,.06);
    --cq-shadow-lg: 0 8px 24px rgba(0,0,0,.10), 0 16px 48px rgba(0,0,0,.08);
    --cq-shadow-green: 0 4px 20px rgba(15,157,88,.25);
    
    --cq-transition: 0.18s ease;
    --cq-transition-slow: 0.3s ease;
}

/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--cq-font);
    font-size: 15px;
    line-height: 1.65;
    color: var(--cq-text);
    background: var(--cq-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   TYPOGRAPHY
   =========================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--cq-text);
    letter-spacing: -0.02em;
}

.cq-mono {
    font-family: var(--cq-font-mono);
}

.text-green {
    color: var(--cq-green) !important;
}

/* ===========================
   NAVBAR
   =========================== */
.cq-navbar {
    background: linear-gradient(135deg, var(--cq-green-darker) 0%, var(--cq-green-dark) 60%, var(--cq-green) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0.65rem 0;
    box-shadow: 0 2px 20px rgba(6,77,39,0.4);
}

.cq-navbar .nav-link {
    color: rgba(255,255,255,0.88) !important;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.45rem 0.85rem !important;
    border-radius: var(--cq-radius-sm);
    transition: all var(--cq-transition);
}

.cq-navbar .nav-link:hover,
.cq-navbar .nav-link.active {
    color: #ffffff !important;
    background: rgba(255,255,255,0.12);
}

.cq-navbar .dropdown-menu {
    background: #ffffff;
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius);
    box-shadow: var(--cq-shadow-lg);
    padding: 0.5rem;
    min-width: 220px;
}

.cq-navbar .dropdown-item {
    border-radius: var(--cq-radius-sm);
    padding: 0.5rem 0.85rem;
    font-size: 0.875rem;
    color: var(--cq-text);
    transition: all var(--cq-transition);
}

.cq-navbar .dropdown-item:hover {
    background: var(--cq-green-lightest);
    color: var(--cq-green-dark);
}

/* Logo */
.cq-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.cq-logo-text {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1;
}

.cq-logo-text span {
    color: rgba(255,255,255,0.7);
}

.cq-logo-badge {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.9);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    align-self: center;
}

/* Search */
.cq-nav-search .form-control {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    min-width: 200px;
    border-radius: var(--cq-radius-sm) 0 0 var(--cq-radius-sm);
}

.cq-nav-search .form-control::placeholder {
    color: rgba(255,255,255,0.5);
}

.cq-nav-search .form-control:focus {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.4);
    color: #ffffff;
    box-shadow: none;
    outline: 2px solid rgba(255,255,255,0.3);
}

.cq-nav-search .btn-success {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.2);
    border-left: none;
    color: #ffffff;
    padding: 0.4rem 0.65rem;
    border-radius: 0 var(--cq-radius-sm) var(--cq-radius-sm) 0;
    transition: all var(--cq-transition);
}

.cq-nav-search .btn-success:hover {
    background: rgba(255,255,255,0.28);
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--cq-green);
    color: white;
    padding: 0.5rem 1rem;
    z-index: 9999;
}
.skip-link:focus {
    top: 0;
}

/* ===========================
   HERO SECTION
   =========================== */
.cq-hero {
    background: linear-gradient(160deg, var(--cq-dark) 0%, var(--cq-green-darker) 35%, var(--cq-green-dark) 70%, var(--cq-green) 100%);
    position: relative;
    overflow: hidden;
    padding: 4.5rem 0 5rem;
}

.cq-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(15,157,88,0.25) 0%, transparent 50%),
        radial-gradient(ellipse 40% 60% at 20% 80%, rgba(6,77,39,0.4) 0%, transparent 50%);
    pointer-events: none;
}

.cq-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--cq-bg));
    pointer-events: none;
}

.cq-hero-content {
    position: relative;
    z-index: 1;
}

.cq-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    margin-bottom: 1.25rem;
}

.cq-hero-title {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.15;
    letter-spacing: -0.04em;
    margin-bottom: 1.25rem;
}

.cq-hero-title .accent {
    color: #4ade80;
    display: inline-block;
}

.cq-hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.78);
    max-width: 580px;
    line-height: 1.65;
    margin-bottom: 2rem;
}

.cq-hero-ctas {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ===========================
   BUTTONS
   =========================== */
.btn-cq-primary {
    background: linear-gradient(135deg, var(--cq-green), var(--cq-green-dark));
    border: 2px solid var(--cq-green);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.5rem;
    border-radius: var(--cq-radius-sm);
    transition: all var(--cq-transition);
    box-shadow: 0 2px 12px rgba(15,157,88,0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-cq-primary:hover {
    background: linear-gradient(135deg, var(--cq-green-dark), var(--cq-green-darker));
    color: #ffffff;
    border-color: var(--cq-green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(15,157,88,0.4);
}

.btn-cq-primary:active {
    transform: translateY(0);
}

.btn-cq-outline {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.35);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.5rem;
    border-radius: var(--cq-radius-sm);
    transition: all var(--cq-transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-cq-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
    color: #ffffff;
}

.btn-cq-green {
    background: linear-gradient(135deg, var(--cq-green), var(--cq-green-dark));
    border: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.65rem 1.75rem;
    border-radius: var(--cq-radius-sm);
    transition: all var(--cq-transition);
    box-shadow: 0 2px 10px rgba(15,157,88,0.25);
    cursor: pointer;
}

.btn-cq-green:hover {
    background: linear-gradient(135deg, var(--cq-green-dark), var(--cq-green-darker));
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(15,157,88,0.35);
}

/* Override Bootstrap success btn */
.btn-success {
    background: linear-gradient(135deg, var(--cq-green), var(--cq-green-dark)) !important;
    border-color: var(--cq-green-dark) !important;
    font-weight: 600;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--cq-green-dark), var(--cq-green-darker)) !important;
    border-color: var(--cq-green-darker) !important;
}

/* ===========================
   STATS SECTION
   =========================== */
.cq-stats {
    background: linear-gradient(135deg, var(--cq-green-darker) 0%, var(--cq-green-dark) 50%, var(--cq-green) 100%);
    padding: 2.5rem 0;
    position: relative;
}

.cq-stat-item {
    text-align: center;
    padding: 1rem;
}

.cq-stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.cq-stat-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.cq-stat-divider {
    width: 1px;
    background: rgba(255,255,255,0.2);
    height: 60px;
    align-self: center;
}

/* ===========================
   CARDS
   =========================== */
.cq-card {
    background: var(--cq-bg-card);
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius);
    box-shadow: var(--cq-shadow);
    transition: all var(--cq-transition-slow);
    overflow: hidden;
}

.cq-card:hover {
    border-color: var(--cq-green);
    box-shadow: var(--cq-shadow-md), 0 0 0 3px rgba(15,157,88,0.06);
    transform: translateY(-2px);
}

/* Tool Card */
.cq-tool-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--cq-bg-card);
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius);
    box-shadow: var(--cq-shadow);
    transition: all var(--cq-transition-slow);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.cq-tool-card:hover {
    border-color: var(--cq-green);
    box-shadow: var(--cq-shadow-md), 0 0 0 3px rgba(15,157,88,0.07);
    transform: translateY(-3px);
    color: inherit;
    text-decoration: none;
}

.cq-tool-card-header {
    padding: 1.25rem 1.25rem 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.cq-tool-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--cq-radius-sm);
    background: var(--cq-green-lightest);
    border: 1px solid rgba(15,157,88,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--cq-green);
    flex-shrink: 0;
}

.cq-tool-badge {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.55rem;
    border-radius: 50px;
    background: var(--cq-green-lightest);
    color: var(--cq-green-dark);
    border: 1px solid rgba(15,157,88,0.2);
}

.cq-tool-card-body {
    padding: 0.85rem 1.25rem 1.25rem;
    flex: 1;
}

.cq-tool-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--cq-text);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.cq-tool-desc {
    font-size: 0.8rem;
    color: var(--cq-text-muted);
    line-height: 1.5;
    margin: 0;
}

.cq-tool-card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--cq-border-light);
    background: var(--cq-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cq-tool-usage {
    font-size: 0.75rem;
    color: var(--cq-text-light);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Category Card */
.cq-category-card {
    background: var(--cq-bg-card);
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--cq-transition-slow);
    text-decoration: none;
    color: inherit;
    display: block;
}

.cq-category-card:hover {
    border-color: var(--cq-green);
    background: var(--cq-green-lightest);
    transform: translateY(-3px);
    box-shadow: var(--cq-shadow-md);
    color: inherit;
    text-decoration: none;
}

.cq-category-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--cq-radius);
    background: linear-gradient(135deg, var(--cq-green), var(--cq-green-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffffff;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 15px rgba(15,157,88,0.3);
}

.cq-category-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--cq-text);
    margin-bottom: 0.25rem;
}

.cq-category-count {
    font-size: 0.78rem;
    color: var(--cq-text-muted);
}

/* ===========================
   TOOL PAGE LAYOUT
   =========================== */
.cq-tool-hero {
    background: linear-gradient(135deg, var(--cq-dark) 0%, var(--cq-green-darker) 50%, var(--cq-green-dark) 100%);
    padding: 2.5rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.cq-tool-hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--cq-bg);
    clip-path: ellipse(55% 100% at 50% 100%);
}

.cq-tool-hero-content {
    position: relative;
    z-index: 1;
}

.cq-tool-hero-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--cq-radius);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #ffffff;
    margin-bottom: 1rem;
}

.cq-tool-hero-title {
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.cq-tool-hero-subtitle {
    color: rgba(255,255,255,0.75);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.cq-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
    margin-bottom: 1.25rem;
}

.cq-breadcrumb a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
}

.cq-breadcrumb a:hover {
    color: rgba(255,255,255,0.9);
}

.cq-breadcrumb .sep {
    font-size: 0.7rem;
    opacity: 0.5;
}

/* ===========================
   TOOL FORM PANEL
   =========================== */
.cq-tool-panel {
    background: var(--cq-bg-card);
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius-lg);
    box-shadow: var(--cq-shadow-md);
    overflow: hidden;
    margin-top: -1.5rem;
    position: relative;
    z-index: 2;
}

.cq-tool-panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--cq-border-light);
    background: var(--cq-bg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cq-tool-panel-body {
    padding: 1.5rem;
}

/* Form Controls */
.cq-input {
    font-family: var(--cq-font);
    font-size: 0.95rem;
    border: 2px solid var(--cq-border);
    border-radius: var(--cq-radius-sm);
    padding: 0.7rem 1rem;
    transition: all var(--cq-transition);
    background: var(--cq-bg);
    color: var(--cq-text);
    width: 100%;
}

.cq-input:focus {
    border-color: var(--cq-green);
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(15,157,88,0.12);
}

.cq-input-mono {
    font-family: var(--cq-font-mono);
    font-size: 0.875rem;
}

/* ===========================
   RESULTS PANEL
   =========================== */
.cq-results {
    background: var(--cq-bg-card);
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius);
    box-shadow: var(--cq-shadow);
    overflow: hidden;
}

.cq-results-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--cq-border-light);
    background: linear-gradient(90deg, var(--cq-green-lightest), #fff);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cq-results-body {
    padding: 1.25rem;
}

/* Result Row */
.cq-result-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--cq-border-light);
}

.cq-result-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cq-result-key {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cq-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 140px;
    padding-top: 0.1rem;
}

.cq-result-value {
    font-size: 0.9rem;
    color: var(--cq-text);
    font-weight: 500;
    flex: 1;
    word-break: break-all;
}

.cq-result-value.mono {
    font-family: var(--cq-font-mono);
    font-size: 0.85rem;
}

/* Status badges */
.cq-badge-success {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
}

.cq-badge-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
}

.cq-badge-warning {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
}

.cq-badge-info {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #e0f2fe;
    color: #0c4a6e;
    border: 1px solid #bae6fd;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
}

/* ===========================
   LOADING STATES
   =========================== */
.cq-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.cq-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--cq-border);
    border-top-color: var(--cq-green);
    border-radius: 50%;
    animation: cq-spin 0.75s linear infinite;
}

@keyframes cq-spin {
    to { transform: rotate(360deg); }
}

.cq-loading-text {
    color: var(--cq-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Skeleton loader */
.cq-skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: cq-skeleton 1.5s infinite;
    border-radius: var(--cq-radius-sm);
}

@keyframes cq-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===========================
   ALERT STYLES
   =========================== */
.cq-alert {
    border-radius: var(--cq-radius);
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid;
}

.cq-alert-success {
    background: #dcfce7;
    border-color: #86efac;
    color: #14532d;
}

.cq-alert-danger {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #7f1d1d;
}

.cq-alert-warning {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #78350f;
}

.cq-alert-info {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0c4a6e;
}

/* ===========================
   SECTIONS
   =========================== */
.cq-section {
    padding: 4rem 0;
}

.cq-section-sm {
    padding: 2.5rem 0;
}

.cq-section-lg {
    padding: 6rem 0;
}

.cq-section-title {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 800;
    color: var(--cq-text);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.cq-section-subtitle {
    font-size: 1rem;
    color: var(--cq-text-muted);
    max-width: 560px;
}

.cq-section-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--cq-green);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cq-section-eyebrow::before {
    content: '';
    width: 20px;
    height: 2px;
    background: var(--cq-green);
    border-radius: 1px;
}

/* ===========================
   FAQ SECTION
   =========================== */
.cq-faq-item {
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: all var(--cq-transition);
}

.cq-faq-item:hover {
    border-color: var(--cq-green);
}

.cq-faq-question {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cq-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--cq-bg-card);
    border: none;
    width: 100%;
    text-align: left;
    transition: all var(--cq-transition);
}

.cq-faq-question:hover {
    background: var(--cq-green-lightest);
    color: var(--cq-green-dark);
}

.cq-faq-question .cq-faq-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--cq-green-lightest);
    color: var(--cq-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all var(--cq-transition);
}

.cq-faq-question[aria-expanded="true"] .cq-faq-icon {
    background: var(--cq-green);
    color: #ffffff;
    transform: rotate(45deg);
}

.cq-faq-answer {
    padding: 0.75rem 1.25rem 1.25rem;
    font-size: 0.875rem;
    color: var(--cq-text-muted);
    line-height: 1.7;
    background: var(--cq-bg-card);
    border-top: 1px solid var(--cq-border-light);
}

/* ===========================
   RELATED TOOLS
   =========================== */
.cq-related {
    background: var(--cq-bg);
    border-radius: var(--cq-radius);
    padding: 1.5rem;
}

.cq-related-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cq-text);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--cq-border);
}

.cq-related-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--cq-radius-sm);
    text-decoration: none;
    color: var(--cq-text);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--cq-transition);
    margin-bottom: 0.15rem;
}

.cq-related-link:hover {
    background: var(--cq-green-lightest);
    color: var(--cq-green-dark);
}

.cq-related-link i {
    color: var(--cq-green);
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ===========================
   COPY BUTTON
   =========================== */
.cq-copy-btn {
    background: none;
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius-sm);
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cq-text-muted);
    cursor: pointer;
    transition: all var(--cq-transition);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.cq-copy-btn:hover {
    background: var(--cq-green-lightest);
    border-color: var(--cq-green);
    color: var(--cq-green-dark);
}

.cq-copy-btn.copied {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

/* ===========================
   CODE / MONOSPACE OUTPUT
   =========================== */
.cq-code-block {
    background: var(--cq-dark);
    border-radius: var(--cq-radius);
    padding: 1.25rem;
    overflow-x: auto;
    border: 1px solid var(--cq-dark-border);
}

.cq-code-block code {
    font-family: var(--cq-font-mono);
    font-size: 0.8rem;
    color: #e6edf3;
    line-height: 1.7;
    white-space: pre;
    display: block;
}

.cq-code-block .kw { color: #ff7b72; }
.cq-code-block .str { color: #a5d6ff; }
.cq-code-block .num { color: #79c0ff; }
.cq-code-block .key { color: #7ee787; }
.cq-code-block .comment { color: #8b949e; }

/* ===========================
   TABLE STYLES
   =========================== */
.cq-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.cq-table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cq-text-muted);
    padding: 0.65rem 1rem;
    background: var(--cq-bg);
    border-bottom: 2px solid var(--cq-border);
    text-align: left;
    white-space: nowrap;
}

.cq-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--cq-border-light);
    color: var(--cq-text);
    vertical-align: middle;
}

.cq-table tr:last-child td {
    border-bottom: none;
}

.cq-table tr:hover td {
    background: var(--cq-bg);
}

.cq-table-container {
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius);
    overflow: hidden;
    overflow-x: auto;
}

/* ===========================
   FORM STYLES
   =========================== */
.cq-form-group {
    margin-bottom: 1.25rem;
}

.cq-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cq-text);
    margin-bottom: 0.4rem;
}

.cq-label .required {
    color: #ef4444;
    margin-left: 0.2rem;
}

.cq-help-text {
    font-size: 0.78rem;
    color: var(--cq-text-muted);
    margin-top: 0.3rem;
}

.cq-select {
    font-family: var(--cq-font);
    font-size: 0.9rem;
    border: 2px solid var(--cq-border);
    border-radius: var(--cq-radius-sm);
    padding: 0.65rem 1rem;
    background: var(--cq-bg);
    color: var(--cq-text);
    width: 100%;
    cursor: pointer;
    transition: all var(--cq-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.cq-select:focus {
    border-color: var(--cq-green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(15,157,88,0.12);
}

.cq-textarea {
    font-family: var(--cq-font);
    font-size: 0.9rem;
    border: 2px solid var(--cq-border);
    border-radius: var(--cq-radius-sm);
    padding: 0.75rem 1rem;
    background: var(--cq-bg);
    color: var(--cq-text);
    width: 100%;
    resize: vertical;
    min-height: 120px;
    transition: all var(--cq-transition);
    line-height: 1.6;
}

.cq-textarea:focus {
    border-color: var(--cq-green);
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(15,157,88,0.12);
}

.cq-textarea.mono {
    font-family: var(--cq-font-mono);
    font-size: 0.85rem;
}

/* ===========================
   SIDEBAR WIDGETS
   =========================== */
.cq-widget {
    background: var(--cq-bg-card);
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.cq-widget-header {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--cq-border-light);
    background: var(--cq-bg);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cq-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cq-widget-header i {
    color: var(--cq-green);
}

.cq-widget-body {
    padding: 1rem 1.25rem;
}

/* ===========================
   IP DISPLAY
   =========================== */
.cq-ip-display {
    background: linear-gradient(135deg, var(--cq-dark), var(--cq-green-darker));
    border-radius: var(--cq-radius-lg);
    padding: 2.5rem;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.cq-ip-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.75rem;
}

.cq-ip-address {
    font-family: var(--cq-font-mono);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    color: #4ade80;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.cq-ip-meta {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.6);
}

/* ===========================
   MAP PLACEHOLDER
   =========================== */
.cq-map {
    background: var(--cq-bg);
    border: 1px solid var(--cq-border);
    border-radius: var(--cq-radius);
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.cq-map-placeholder {
    text-align: center;
    color: var(--cq-text-muted);
}

/* ===========================
   FOOTER
   =========================== */
.cq-footer {
    background: var(--cq-dark);
    color: rgba(255,255,255,0.75);
}

.cq-footer-top {
    padding: 3.5rem 0 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cq-footer-brand .cq-footer-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.cq-footer-desc {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.cq-footer-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cq-badge-stat {
    background: rgba(15,157,88,0.2);
    border: 1px solid rgba(15,157,88,0.3);
    color: #4ade80;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cq-footer-heading {
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cq-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cq-footer-links li {
    margin-bottom: 0.4rem;
}

.cq-footer-links a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.82rem;
    transition: all var(--cq-transition);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.cq-footer-links a:hover {
    color: #4ade80;
    transform: translateX(3px);
}

.cq-footer-bottom {
    padding: 1.25rem 0;
}

.cq-footer-copy {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
    margin: 0;
}

.cq-footer-copy a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
}

.cq-footer-copy a:hover {
    color: #4ade80;
}

.cq-status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    margin-right: 0.35rem;
    animation: pulse-dot 2s ease infinite;
    vertical-align: middle;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.3); }
}

/* ===========================
   UTILITIES
   =========================== */
.cq-divider {
    height: 1px;
    background: var(--cq-border);
    margin: 1.5rem 0;
}

.cq-text-mono {
    font-family: var(--cq-font-mono);
    font-size: 0.85em;
}

.cq-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cq-hover-underline:hover {
    text-decoration: underline;
}

/* Progress bars */
.cq-progress {
    height: 6px;
    background: var(--cq-border);
    border-radius: 3px;
    overflow: hidden;
}

.cq-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cq-green), var(--cq-green-dark));
    border-radius: 3px;
    transition: width 0.6s ease;
}

.cq-progress-bar.danger {
    background: linear-gradient(90deg, #f97316, #ef4444);
}

.cq-progress-bar.warning {
    background: linear-gradient(90deg, #fbbf24, #f97316);
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 991px) {
    .cq-hero {
        padding: 2.5rem 0 3.5rem;
    }
    
    .cq-stat-divider {
        display: none;
    }
    
    .cq-tool-panel {
        margin-top: -1rem;
    }
    
    .cq-result-key {
        min-width: 110px;
    }
    
    .cq-nav-search {
        margin: 0.5rem 0;
    }
    
    .cq-nav-search .form-control {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .cq-hero-title {
        font-size: 1.9rem;
    }
    
    .cq-hero-ctas {
        flex-direction: column;
    }
    
    .cq-btn-primary,
    .cq-btn-outline {
        width: 100%;
        justify-content: center;
    }
    
    .cq-result-row {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .cq-result-key {
        min-width: auto;
    }
    
    .cq-tool-panel-body {
        padding: 1rem;
    }
    
    .cq-section {
        padding: 2.5rem 0;
    }
    
    .cq-ip-display {
        padding: 1.75rem 1.25rem;
    }
}

/* ===========================
   PRINT STYLES
   =========================== */
@media print {
    .cq-navbar,
    .cq-footer,
    .cq-hero,
    .cq-related,
    .cq-faq-item .cq-faq-answer {
        display: none !important;
    }
    
    body {
        font-size: 12px;
        background: white;
    }
    
    .cq-results {
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* ===========================
   REDUCED MOTION
   =========================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .cq-status-dot {
        animation: none;
    }
}

/* ===========================
   DARK MODE (optional)
   =========================== */
@media (prefers-color-scheme: dark) {
    /* Deliberately not auto-applying dark mode
       to maintain brand consistency */
}

/* ===========================
   ADMIN OVERRIDES (not in main)
   =========================== */
.admin-sidebar {
    background: var(--cq-dark-secondary);
    min-height: 100vh;
    width: 250px;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    z-index: 100;
    border-right: 1px solid var(--cq-dark-border);
}

/* ── Additional Tool Page Styles ─────────────────────────────────────────── */
.tool-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: .95rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}
.tool-input:focus {
    border-color: #0f9d58;
    box-shadow: 0 0 0 3px rgba(15,157,88,.1);
}
textarea.tool-input { resize: vertical; min-height: 120px; font-family: 'JetBrains Mono', monospace; font-size: .85rem; }
select.tool-input { cursor: pointer; }
.tool-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #0f9d58, #0b7a3e);
    border: none;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    font-size: .95rem;
}
.tool-btn:hover { opacity: .9; }
.tool-btn:active { transform: scale(.98); }
.tool-btn:disabled { opacity: .5; cursor: not-allowed; }
.results-box { margin-top: 20px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.results-header { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: rgba(15,157,88,.04); }
.results-body { padding: 8px 0; }
.result-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 18px; border-bottom: 1px solid rgba(255,255,255,.03); gap: 16px; }
.result-row:last-child { border-bottom: none; }
.result-label { color: var(--text-muted); font-size: .83rem; min-width: 160px; flex-shrink: 0; padding-top: 2px; }
.result-value { color: var(--text-primary); font-size: .875rem; font-weight: 500; text-align: right; word-break: break-all; flex: 1; }
.badge-success { display: inline-flex; align-items: center; background: rgba(15,157,88,.15); color: #0f9d58; padding: 3px 10px; border-radius: 50px; font-size: .78rem; font-weight: 600; }
.badge-danger { display: inline-flex; align-items: center; background: rgba(248,81,73,.15); color: #f85149; padding: 3px 10px; border-radius: 50px; font-size: .78rem; font-weight: 600; }
.badge-warning { display: inline-flex; align-items: center; background: rgba(227,179,65,.15); color: #e3b341; padding: 3px 10px; border-radius: 50px; font-size: .78rem; font-weight: 600; }
.loading-spinner { display: flex; align-items: center; gap: 12px; color: var(--text-muted); padding: 24px 0; font-size: .9rem; }
.form-label { color: var(--text-muted); font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.form-text { color: var(--text-muted); font-size: .78rem; margin-top: 5px; }
.input-group-text { background: var(--bg-secondary); border-color: var(--border); color: var(--text-muted); }
.alert-danger { background: rgba(248,81,73,.08); border: 1px solid rgba(248,81,73,.2); color: #f85149; border-radius: 8px; padding: 14px 18px; }
.alert-success { background: rgba(15,157,88,.08); border: 1px solid rgba(15,157,88,.2); color: #0f9d58; border-radius: 8px; padding: 14px 18px; }
.alert-warning { background: rgba(227,179,65,.08); border: 1px solid rgba(227,179,65,.2); color: #e3b341; border-radius: 8px; padding: 14px 18px; }
pre { background: #0d1117; border: 1px solid var(--border); border-radius: 8px; padding: 16px; color: #e6edf3; font-size: .83rem; overflow-x: auto; }
code { background: rgba(15,157,88,.08); color: #0f9d58; padding: 2px 6px; border-radius: 4px; font-size: .85em; }
.font-monospace { font-family: 'JetBrains Mono', 'Fira Code', monospace !important; }
.table-tool { width: 100%; border-collapse: collapse; }
.table-tool th { padding: 10px 14px; color: var(--text-muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.table-tool td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.03); color: var(--text-primary); font-size: .875rem; }
.table-tool tr:last-child td { border-bottom: none; }
.table-tool tr:hover td { background: rgba(15,157,88,.03); }
/* Accordion overrides */
.accordion-button::after { filter: invert(1); }
.accordion-button:not(.collapsed) { color: #0f9d58; background: rgba(15,157,88,.06); }
/* Mobile responsive */
@media (max-width: 768px) {
    .result-row { flex-direction: column; gap: 4px; }
    .result-label { min-width: unset; }
    .result-value { text-align: left; }
    .tool-main-body, .tool-main-header { padding: 16px; }
}
