/*
Theme Name: Cloudsgo Portal Theme
Theme URI: https://cloudsgo.org/
Author: Startgo & DeepMind Team
Author URI: https://cloudsgo.org/
Description: Modern WHMCS-style Client Portal Theme for Cloudsgo Partner Technology Hosting.
Version: 1.0.1
License: GNU General Public License v2 or later
Text Domain: cloudsgo-portal
*/

@font-face {
	font-family: 'BpmfZihiKaiStd';
	src: url('assets/fonts/BpmfZihiKaiStd-Regular.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

:root {
	--cg-bg: #e0f7f6;
	--cg-header-bg: #ffffff;
	--cg-nav-bg: #ffffff;
	--cg-footer-bg: #334155;
	--cg-text-dark: #1e293b;
	--cg-text-muted: #64748b;
	--cg-primary: #0284c7;
	--cg-border: #cbd5e1;
        --cg-container-max: 1200px;
        --cg-nav-max: 1480px;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background-color: var(--cg-bg);
	color: var(--cg-text-dark);
	line-height: 1.6;
}

a {
	color: var(--cg-primary);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

/* Container */
.cg-container {
        max-width: var(--cg-container-max);
	margin: 0 auto;
	padding: 0 20px;
}

/* Header Top */
.cg-header-top {
	background: var(--cg-header-bg);
	padding: 15px 0;
	border-bottom: 1px solid #e2e8f0;
}

.cg-header-flex {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 15px;
}

.cg-logo {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
}

.cg-logo-icon {
	font-size: 28px;
}

.cg-logo-text {
	font-size: 20px;
	font-weight: 800;
	color: #0284c7;
	letter-spacing: -0.5px;
}

.cg-header-right {
	display: flex;
	align-items: center;
	gap: 15px;
        flex-wrap: wrap;
        flex: 1 1 420px;
        justify-content: flex-end;
        min-width: min(100%, 340px);
}

.cg-search-box {
	position: relative;
        flex: 1 1 380px;
        min-width: min(100%, 340px);
        max-width: 100%;
}

.cg-search-input {
	padding: 8px 14px 8px 36px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 13px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
	outline: none;
}

.cg-search-input:focus {
	border-color: #0284c7;
}

.cg-search-icon {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	color: #94a3b8;
	font-size: 14px;
}

@media (max-width: 782px) {
        .cg-header-right {
                width: 100%;
        }

        .cg-search-box {
                flex-basis: 100%;
                min-width: 0;
        }

        .cg-search-input {
                width: 100%;
        }
}

.cg-cart-btn {
	background: #f1f5f9;
	border: 1px solid #cbd5e1;
	padding: 6px 14px;
	border-radius: 6px;
	font-weight: 700;
	color: #475569;
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	text-decoration: none;
}

.cg-cart-btn:hover {
	background: #e2e8f0;
	text-decoration: none;
}

.cg-cart-count {
	background: #0284c7;
	color: #ffffff;
	border-radius: 50%;
	width: 18px;
	height: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
}

/* Navbar */
.cg-navbar {
	background: var(--cg-nav-bg);
	border-bottom: 1px solid #e2e8f0;
}

.cg-container-nav {
        max-width: var(--cg-nav-max);
        padding-left: 28px;
        padding-right: 28px;
}

.cg-nav-list {
	display: flex;
	list-style: none;
        justify-content: center;
        gap: clamp(10px, 0.9vw, 18px);
	align-items: center;
        overflow-x: visible;
        flex-wrap: nowrap;
        padding: 12px 0;
}

.cg-nav-item {
        flex: 0 0 auto;
}

.cg-nav-item a {
	color: #334155;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
        padding: 6px 8px;
	border-radius: 4px;
	transition: all 0.2s;
}

.cg-nav-item a:hover {
	color: #0284c7;
	background: #f0f9ff;
	text-decoration: none;
}

@media (max-width: 1440px) {
        .cg-container-nav {
                max-width: 100%;
                padding-left: 20px;
                padding-right: 20px;
        }

        .cg-nav-list {
                gap: 10px;
        }

        .cg-nav-item a {
                padding-left: 6px;
                padding-right: 6px;
        }
}

@media (max-width: 1280px) {
        .cg-nav-list {
                flex-wrap: wrap;
                row-gap: 6px;
                overflow-x: visible;
        }
}

/* Sub-header Breadcrumb */
.cg-breadcrumb-bar {
	background: #e2e8f0;
	padding: 10px 0;
	font-size: 13px;
	color: #64748b;
}

.cg-breadcrumb-flex {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        min-height: 20px;
}

.cg-subheader-text,
.cg-subheader-link {
        color: #64748b;
        font-weight: 600;
        text-decoration: none;
}

.cg-subheader-link:hover {
        color: #0f172a;
        text-decoration: underline;
}

.cg-subheader-menu,
.cg-subheader-menu ul {
        list-style: none;
        margin: 0;
        padding: 0;
}

.cg-subheader-menu {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
}

.cg-subheader-menu a {
        color: #64748b;
        text-decoration: none;
        font-weight: 600;
}

.cg-subheader-menu a:hover {
        color: #0f172a;
        text-decoration: underline;
}

.cg-subheader-widget {
        color: #64748b;
        max-width: 100%;
}

.cg-subheader-widget-title {
        margin: 0 0 4px;
        font-size: 13px;
        font-weight: 700;
        color: #475569;
}

.cg-subheader-widget p,
.cg-subheader-widget li,
.cg-subheader-widget a {
        color: #64748b;
        font-size: 13px;
        font-weight: 600;
}

.cg-subheader-widget p:last-child {
        margin-bottom: 0;
}

/* Main Section Layout */
.cg-main-body {
	padding: 40px 0 60px 0;
}

.cg-homepage-content > *:last-child {
        margin-bottom: 0;
}

.cg-homepage-content .cg-products-grid > p,
.cg-homepage-content .cg-help-grid > p,
.cg-homepage-content .cg-account-grid > p {
        display: contents;
        margin: 0;
}

.cg-homepage-content .cg-section-title,
.cg-homepage-content .cg-products-grid,
.cg-homepage-content .cg-help-grid,
.cg-homepage-content .cg-account-grid {
        margin-left: auto;
        margin-right: auto;
}

.cg-section-title {
	text-align: center;
	font-size: 26px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 30px;
}

.cg-section-title-bilingual {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        line-height: 1.15;
}

.cg-section-title-primary,
.cg-section-title-secondary {
        display: block;
}

.cg-section-title-secondary {
        font-size: 0.72em;
        font-weight: 600;
        color: #64748b;
        letter-spacing: 0.03em;
}

/* Products Grid */
.cg-products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 25px;
	margin-bottom: 50px;
}

.cg-products-grid > .wp-block-column,
.cg-help-grid > .wp-block-column,
.cg-account-grid > .wp-block-column {
        margin: 0 !important;
}

.cg-product-card {
	background: #ffffff;
	border-radius: 8px;
	padding: 30px 20px;
	text-align: center;
	box-shadow: 0 4px 12px rgba(0,0,0,0.03);
	border: 1px solid #e2e8f0;
	transition: transform 0.2s, box-shadow 0.2s;
}

.cg-product-card,
.cg-help-card,
.cg-account-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        height: 100%;
}

.cg-product-card .wp-block-buttons {
        margin-bottom: 0;
}

.cg-product-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.cg-product-title {
	font-size: 20px;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: 20px;
}

.cg-front-widget-card {
        display: flex;
        flex-direction: column;
        justify-content: center;
}

.cg-front-widget-card .widget-title {
        margin: 0 0 20px;
        text-align: center;
}

.cg-front-widget-card .wp-block-buttons,
.cg-front-widget-card .wp-block-button,
.cg-front-widget-card .wp-block-group,
.cg-front-widget-card .wp-block-columns {
        justify-content: center;
}

.cg-front-widget-card .wp-block-buttons {
        margin-bottom: 0;
}

.cg-front-widget-card p,
.cg-front-widget-card li {
        text-align: center;
}

.cg-front-widget-card p:last-child {
        margin-bottom: 0;
}

.cg-btn-outline {
	display: inline-block;
	border: 1.5px solid #0284c7;
	color: #0284c7;
	padding: 8px 30px;
	border-radius: 6px;
	font-weight: 700;
	font-size: 14px;
	transition: all 0.2s;
}

.cg-btn-outline:hover {
	background: #0284c7;
	color: #ffffff;
	text-decoration: none;
}

.cg-help-label a,
.cg-account-label a {
        color: inherit;
        text-decoration: none;
}

.cg-help-label a:hover,
.cg-account-label a:hover {
        text-decoration: none;
}

/* Help Grid */
.cg-help-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 15px;
	margin-bottom: 50px;
}

.cg-help-card {
	background: #ffffff;
	border-radius: 8px;
	padding: 25px 15px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0,0,0,0.03);
	border-top: 4px solid #cbd5e1;
	transition: transform 0.2s;
	text-decoration: none !important;
	display: block;
}

.cg-help-card:hover {
	transform: translateY(-3px);
}

.cg-help-card.cyan { border-top-color: #06b6d4; }
.cg-help-card.red { border-top-color: #ef4444; }
.cg-help-card.yellow { border-top-color: #eab308; }
.cg-help-card.blue { border-top-color: #3b82f6; }
.cg-help-card.green { border-top-color: #22c55e; }

.cg-help-icon {
	font-size: 32px;
	margin-bottom: 10px;
}

.cg-help-label {
	font-size: 14px;
	font-weight: 700;
	color: #334155;
}

/* Account Grid */
.cg-account-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
}

.cg-account-card {
	background: #ffffff;
	border-radius: 8px;
	padding: 25px 20px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0,0,0,0.03);
	border: 1px solid #e2e8f0;
	text-decoration: none !important;
	display: block;
	transition: transform 0.2s;
}

.cg-account-card:hover {
	transform: translateY(-3px);
}

.cg-account-icon {
	font-size: 30px;
	margin-bottom: 8px;
	color: #94a3b8;
}

.cg-account-label {
	font-size: 15px;
	font-weight: 700;
	color: #334155;
}

/* Standard Page Content */
.cg-page-content > * + * {
        margin-top: 1rem;
}

.cg-page-content h2,
.cg-page-content h3 {
        color: #0f172a;
        line-height: 1.4;
}

.cg-page-content p,
.cg-page-content li {
        color: #334155;
}

.cg-page-content ul,
.cg-page-content ol {
        padding-left: 1.4rem;
}

.cg-legal-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
        margin: 1.25rem 0;
}

.cg-legal-card {
        padding: 18px 20px;
        border: 1px solid #cbd5e1;
        border-radius: 14px;
        background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.cg-page-content .cg-legal-card > * + * {
        margin-top: 0.75rem;
}

.cg-legal-card h3 {
        margin: 0;
        color: #0f172a;
        font-size: 1.05em;
}

.cg-legal-card-subtitle {
        margin: 0;
        color: #64748b;
        font-size: 0.95em;
}

.cg-legal-meta {
        margin: 0;
        padding-left: 1.2rem;
}

.cg-legal-meta li + li {
        margin-top: 0.55rem;
}

.cg-page-content table {
        width: 100%;
        border-collapse: collapse;
        margin: 1.25rem 0;
        font-size: 0.95em;
        background: #ffffff;
        border: 1px solid #cbd5e1;
        border-radius: 10px;
        overflow: hidden;
}

.cg-page-content th,
.cg-page-content td {
        border: 1px solid #cbd5e1;
        padding: 12px 14px;
        vertical-align: top;
        text-align: left;
}

.cg-page-content th {
        background: #f8fafc;
        color: #0f172a;
        font-weight: 700;
}

@media (max-width: 782px) {
        .cg-legal-grid {
                grid-template-columns: 1fr;
        }

        .cg-page-content {
                overflow-x: auto;
        }

        .cg-page-content table {
                min-width: 720px;
        }
}

/* Footer */
.cg-footer {
	background: var(--cg-footer-bg);
	color: #94a3b8;
	padding: 30px 0;
	font-size: 13px;
}

.cg-footer-widgets {
        margin-bottom: 25px;
        padding-bottom: 20px;
        border-bottom: 1px solid #475569;
}

.cg-footer-widgets .widget,
.cg-footer-utility-widget {
        max-width: 100%;
}

.cg-footer-widgets .wp-block-social-links,
.cg-footer-utility-widgets .wp-block-social-links {
        margin: 0;
        gap: 8px;
}

.cg-footer-widgets .wp-block-social-link,
.cg-footer-utility-widgets .wp-block-social-link {
        margin: 0;
}

.cg-footer-widgets .wp-block-social-link a,
.cg-footer-utility-widgets .wp-block-social-link a {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        padding: 6px;
}

.cg-footer-widgets .wp-block-social-link svg,
.cg-footer-utility-widgets .wp-block-social-link svg,
.cg-footer-widgets .wp-block-image img,
.cg-footer-utility-widgets .wp-block-image img,
.cg-footer-widgets .dashicons,
.cg-footer-utility-widgets .dashicons {
        width: 16px;
        height: 16px;
        max-width: 16px;
        max-height: 16px;
        font-size: 16px;
}

.cg-footer-widgets .wp-block-button__link,
.cg-footer-utility-widgets .wp-block-button__link {
        font-size: 12px;
        padding: 6px 10px;
}

.cg-footer-widgets p,
.cg-footer-widgets li,
.cg-footer-utility-widgets p,
.cg-footer-utility-widgets li {
        font-size: 12px;
        line-height: 1.6;
}

.cg-footer-flex {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 15px;
	margin-bottom: 20px;
}

.cg-footer-links a {
	color: #cbd5e1;
	font-weight: 600;
}

.cg-footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.cg-footer-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: 1px solid #64748b;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cg-footer-link-btn:hover {
    background: rgba(14, 165, 233, 0.16);
    border-color: #38bdf8;
    color: #ffffff;
    text-decoration: none;
}

.cg-footer-right {
	display: flex;
	align-items: center;
        flex-wrap: wrap;
	gap: 10px;
}

.cg-footer-system-actions {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
}

.cg-footer-utility-widgets {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
}

.cg-footer-utility-widget {
        color: #cbd5e1;
        font-size: 12px;
}

.cg-footer-action-list,
.cg-footer-action-list ul {
        list-style: none;
        margin: 0;
        padding: 0;
}

.cg-footer-action-list {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
}

.cg-footer-action-list li {
        margin: 0;
}

.cg-footer-action-list a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 32px;
        padding: 4px 10px;
        border-radius: 4px;
        background: #475569;
        color: #ffffff;
        text-decoration: none;
        border: 1px solid transparent;
        font-weight: 600;
        font-size: 12px;
        transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cg-footer-action-list a:hover {
        background: #0f172a;
        color: #ffffff;
        text-decoration: none;
}

.cg-footer-email-btn {
        background: rgba(14, 165, 233, 0.16);
        border-color: #38bdf8;
        color: #ffffff;
}

.cg-footer-report-btn {
        background: rgba(20, 184, 166, 0.14);
        border-color: #2dd4bf;
        color: #ffffff;
}

.cg-fb-btn {
	background: #475569;
	color: #ffffff;
	width: 28px;
	height: 28px;
	border-radius: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 14px;
}

.cg-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #475569;
    color: #ffffff;
    padding: 4px 10px;
	border-radius: 4px;
	font-weight: 600;
	font-size: 12px;
    text-decoration: none;
    border: 1px solid transparent;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
    line-height: 1.2;
    min-height: 32px;
    white-space: nowrap;
    font-family: inherit;
    cursor: pointer;
}

.cg-lang-btn:hover {
    background: #0f172a;
    color: #ffffff;
    text-decoration: none;
}

.cg-lang-btn.is-active {
    background: #0284c7;
    border-color: #7dd3fc;
}

.cg-locale-switcher {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.cg-locale-form {
    display: inline-flex;
    margin: 0;
}

.cg-lang-btn {
    cursor: pointer;
}

.cg-currency-btn {
        background: #1e293b;
        border-color: #475569;
}

.cg-feedback-btn {
        background: #0f766e;
        border-color: #14b8a6;
}

.cg-copyright {
	text-align: center;
	color: #64748b;
	font-size: 12px;
	border-top: 1px solid #475569;
	padding-top: 15px;
}

@media (max-width: 782px) {
        .cg-footer-flex {
                flex-direction: column;
                align-items: stretch;
                gap: 16px;
        }

        .cg-footer-links,
        .cg-footer-right,
        .cg-footer-system-actions,
        .cg-footer-action-list,
        .cg-footer-utility-widgets {
                width: 100%;
        }

        .cg-footer-right {
                flex-direction: column;
                align-items: stretch;
                gap: 12px;
        }

        .cg-footer-links {
                gap: 8px 12px;
                line-height: 1.5;
        }

        .cg-footer-system-actions {
                display: grid;
                grid-template-columns: 1fr;
                gap: 10px;
        }

        .cg-footer-link-btn,
        .cg-footer-action-list a {
                width: 100%;
                max-width: 100%;
                white-space: normal;
                text-align: center;
        }

        .cg-locale-switcher {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                width: 100%;
                gap: 8px;
        }

        .cg-lang-btn {
                width: 100%;
                max-width: 100%;
                white-space: normal;
        }
}
