/* ==============================================
   UNIVERSAL CMS TEMPLATE STYLESHEET
   Enhanced with modern practices & utility classes
   ============================================== */

/* ==============================================
   1.0 - CSS RESET & BASE NORMALIZATION
   ============================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

/* HTML5 display-role reset */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}

body {
    line-height: 1;
}

ol, ul {
    list-style: none;
}

blockquote, q {
    quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* ==============================================
   2.0 - ROOT & GLOBAL VARIABLES
   ============================================== */
:root {
    /* Spacing Scale */
    --space-unit: 0.25rem;
    --space-xxs: calc(0.5 * var(--space-unit));
    --space-xs: calc(1 * var(--space-unit));
    --space-sm: calc(2 * var(--space-unit));
    --space-md: calc(4 * var(--space-unit));
    --space-lg: calc(8 * var(--space-unit));
    --space-xl: calc(16 * var(--space-unit));
    
    /* Color System */
    --color-primary: #7c4dff;
    --color-secondary: #5ac8fa;
    --color-accent: #7c4dff;
    --color-accent2: #5ac8fa;
    --color-muted: #b9c2e6;
    --color-dark: #07122b;
    --color-darker: #041025;
    --color-panel: #0f1632;
    --color-card: #0f1940;
    
    /* Typography */
    --font-base: 10px;
    --font-scale: 1.25;
    --font-size-xs: calc(var(--font-base) * 0.75);
    --font-size-sm: calc(var(--font-base) * 0.875);
    --font-size-md: var(--font-base);
    --font-size-lg: calc(var(--font-base) * 1.125);
    --font-size-xl: calc(var(--font-base) * 1.25);
    --font-size-2xl: calc(var(--font-base) * 1.5);
    --font-size-3xl: calc(var(--font-base) * 1.875);
    --font-size-4xl: calc(var(--font-base) * 2.25);
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==============================================
   3.0 - BASE TYPOGRAPHY & BODY
   ============================================== */
html {
    font-size: var(--font-base);
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'BlinkMacSystemFont', -apple-system, 'Lato', 'Roboto', system-ui, Arial, sans-serif;
    font-size: 1.4rem;
    line-height: 1.6;
    color: #fff;
    background: linear-gradient(180deg, var(--color-dark), var(--color-darker));
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
}

/* ==============================================
   4.0 - TYPOGRAPHY ENHANCEMENTS
   ============================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: inherit;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-md); }

p {
    margin-bottom: var(--space-md);
}

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

a:hover {
    color: var(--color-secondary);
}

strong, b {
    font-weight: 700;
}

small {
    font-size: var(--font-size-sm);
}

/* ==============================================
   5.0 - UTILITY CLASSES FOR CMS
   ============================================== */

/* Spacing Utilities */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.ml-0 { margin-left: 0 !important; }
.mr-0 { margin-right: 0 !important; }
.m-0 { margin: 0 !important; }

.mt-1 { margin-top: var(--space-unit) !important; }
.mb-1 { margin-bottom: var(--space-unit) !important; }
.mt-2 { margin-top: var(--space-sm) !important; }
.mb-2 { margin-bottom: var(--space-sm) !important; }
.mt-4 { margin-top: var(--space-md) !important; }
.mb-4 { margin-bottom: var(--space-md) !important; }
.mt-8 { margin-top: var(--space-lg) !important; }
.mb-8 { margin-bottom: var(--space-lg) !important; }

.p-0 { padding: 0 !important; }
.p-2 { padding: var(--space-sm) !important; }
.p-4 { padding: var(--space-md) !important; }
.p-8 { padding: var(--space-lg) !important; }

/* Text Utilities */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-muted { color: var(--color-muted) !important; }
.text-primary { color: var(--color-primary) !important; }
.text-secondary { color: var(--color-secondary) !important; }

/* Flex Utilities */
.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.items-center { align-items: center !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.gap-2 { gap: var(--space-sm) !important; }
.gap-4 { gap: var(--space-md) !important; }

/* Grid Utilities */
.grid { display: grid !important; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }

/* Display Utilities */
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-none { display: none !important; }

/* Width & Height */
.w-full { width: 100% !important; }
.w-auto { width: auto !important; }
.h-full { height: 100% !important; }
.h-auto { height: auto !important; }

/* ==============================================
   6.0 - COMPONENT STYLES
   ============================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-md);
    line-height: 1;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: color-mix(in srgb, var(--color-primary) 90%, black);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: white;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Cards & Panels */
.card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-md);
}

.panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border-radius: var(--radius-xl);
    padding: var(--space-md);
    margin: var(--space-md) 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--color-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: white;
    font-size: var(--font-size-md);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.18);
}

.form-control::placeholder {
    color: var(--color-muted);
}

/* ==============================================
   7.0 - LOADING & ANIMATIONS
   ============================================== */
.cp_preloader, .cp_loading_logo {
    position: absolute;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    position: absolute;
    width: 80px;
    height: 80px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: .3s;
    opacity: 0;
    transform: scale(0);
    animation: zoomIn .4s ease both;
    animation-delay: .3s;
}

.spinner__inner {
    width: 100%;
    height: 100%;
    animation: circle infinite .6s linear;
    backface-visibility: hidden;
    border: 4px solid rgb(154, 154, 154);
    border-top-color: rgb(230, 230, 230);
    border-right-color: rgb(230, 230, 230);
    border-bottom-color: rgb(230, 230, 230);
    border-radius: 100%;
}

/* ==============================================
   8.0 - LAYOUT COMPONENTS
   ============================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.page {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 var(--space-md);
}

/* ==============================================
   9.0 - MEDIA & IMAGES
   ============================================== */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* ==============================================
   10.0 - RESPONSIVE DESIGN
   ============================================== */
@media (max-width: 768px) {
    :root {
        --font-base: 9px;
    }
    .container { padding: 0 var(--space-sm); }
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
    .flex-col-mobile { flex-direction: column !important; }
    .text-center-mobile { text-align: center !important; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    :root { --font-base: 9.5px; }
    .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* ==============================================
   11.0 - ANIMATIONS & KEYFRAMES
   ============================================== */
@keyframes zoomIn { to { opacity: 1; transform: scale(1); } }
@keyframes circle { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ==============================================
   12.0 - PRINT STYLES
   ============================================== */
@media print {
    .no-print { display: none !important; }
    body { background: white !important; color: black !important; }
    a { color: black !important; text-decoration: underline !important; }
}

/* ==============================================
   13.0 - ACCESSIBILITY
   ============================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: white;
    padding: 8px;
    z-index: 10000;
}

.skip-link:focus { top: 0; }

/* ==============================================
   14.0 - ERROR & STATUS STATES
   ============================================== */
.noscript, .error {
    text-align: center;
    margin: 50px auto;
    font-size: 20px;
    display: block;
}

.error { color: #ff6b6b; }
.success { color: #51cf66; }
.warning { color: #ffd43b; }
.info { color: #339af0; }

/* ==============================================
   15.0 - CLEARFIX & HELPERS
   ============================================== */
.clearfix::before, .clearfix::after { content: " "; display: table; }
.clearfix::after { clear: both; }

/* Site Builder Isolation */
.site-builder {
    /* Your site builder specific styles here */
    /* This section is isolated for your onboarding tools */
}

/* ==============================================
   END OF UNIVERSAL CMS STYLESHEET
   ============================================== */