/**
 * Phantom Realty Engine - Base Styles & Typography
 * Beaver Builder Theme Integration: Colors adapt to active theme
 * 
 * Foundation styles that depend on variables from 01-variables.css
 * Includes HTML resets, typography system, and global base styles.
 * 
 * @package PhantomRealtyEngine
 * @subpackage CSS-Base
 * @version 2.0.0
 * @order 02
 * @depends 01-variables.css
 */

/* ================================
   BASE RESET & FOUNDATION - SCOPED
   ================================ */

.pre-content-area *,
.pre-content-area {
    box-sizing: border-box;
}

.pre-content-area *::before,
.pre-content-area *::after {
    box-sizing: border-box;
}

.pre-content-area {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
}

/* REMOVED GLOBAL BODY STYLES - Moved to scoped selectors */
/* Global body styles were causing black background in WordPress admin */

/* WordPress Admin Integration - SCOPED to main content only, not sidebar */
.toplevel_page_pre-realty .wrap,
.pre-realty_page .wrap,
body[class*='pre-realty_page'] .wrap {
    background-color: var(--pre-black);
    color: var(--pre-gray);
    font-family: var(--pre-font-family);
    padding: 20px;
    border-radius: 8px;
    margin: 20px;
}

/* Keep WordPress admin elements default - NO styling */
/* #adminmenu, #adminmenuback, #wpadminbar should remain default */

/* Ensure admin sidebar stays default - DO NOT style #adminmenu */
/* Admin sidebar should maintain WordPress default appearance */

/* ================================
   TYPOGRAPHY SYSTEM
   ================================ */

/* Headings - SCOPED to prevent global conflicts */
.pre-content-area h1,
.pre-content-area h2,
.pre-content-area h3,
.pre-content-area h4,
.pre-content-area h5,
.pre-content-area h6 {
    font-family: var(--pre-font-headings);
    font-weight: var(--pre-font-bold);
    line-height: 1.2;
    margin: 0 0 var(--pre-space-md) 0;
    color: var(--pre-white);
}

.pre-content-area h1 {
    font-size: var(--pre-text-4xl);
    font-weight: var(--pre-font-extrabold);
}

.pre-content-area h2 {
    font-size: var(--pre-text-3xl);
    font-weight: var(--pre-font-bold);
}

.pre-content-area h3 {
    font-size: var(--pre-text-2xl);
    font-weight: var(--pre-font-bold);
}

.pre-content-area h4 {
    font-size: var(--pre-text-xl);
    font-weight: var(--pre-font-semibold);
}

.pre-content-area h5 {
    font-size: var(--pre-text-lg);
    font-weight: var(--pre-font-semibold);
}

.pre-content-area h6 {
    font-size: var(--pre-text-base);
    font-weight: var(--pre-font-semibold);
}

/* Montserrat Premium Headings */
.pre-title,
.pre-premium-title,
h1.pre-heading,
h2.pre-heading,
h3.pre-heading {
    font-family: 'Montserrat', sans-serif;
    font-weight: var(--pre-font-bold);
    font-style: italic;
    background: linear-gradient(90deg, var(--pre-green), var(--pre-green-light));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

/* Paragraph Text - SCOPED to prevent global conflicts */
.pre-content-area p {
    margin: 0 0 var(--pre-space-md) 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Links - SCOPED to prevent global conflicts */
.pre-content-area a {
    color: var(--pre-green);
    text-decoration: none;
    transition: var(--pre-transition);
}

.pre-content-area a:hover {
    color: var(--pre-green-light);
    text-decoration: underline;
}

.pre-content-area a:focus {
    outline: 2px solid var(--pre-green);
    outline-offset: 2px;
}

/* Text Utilities */
.pre-text-xs {
    font-size: var(--pre-text-xs);
}

.pre-text-sm {
    font-size: var(--pre-text-sm);
}

.pre-text-base {
    font-size: var(--pre-text-base);
}

.pre-text-lg {
    font-size: var(--pre-text-lg);
}

.pre-text-xl {
    font-size: var(--pre-text-xl);
}

.pre-text-2xl {
    font-size: var(--pre-text-2xl);
}

.pre-font-normal {
    font-weight: var(--pre-font-normal);
}

.pre-font-medium {
    font-weight: var(--pre-font-medium);
}

.pre-font-semibold {
    font-weight: var(--pre-font-semibold);
}

.pre-font-bold {
    font-weight: var(--pre-font-bold);
}

.pre-italic {
    font-style: italic;
}

.pre-uppercase {
    text-transform: uppercase;
}

.pre-lowercase {
    text-transform: lowercase;
}

.pre-capitalize {
    text-transform: capitalize;
}

/* ================================
   DASHBOARD TYPOGRAPHY
   ================================ */

/* Normal pages - reasonable sizes */
body[class*='pre-realty']:not(.pre-realty_page_pre-debug) p,
body[class*='pre-realty']:not(.pre-realty_page_pre-debug) td,
body[class*='pre-realty']:not(.pre-realty_page_pre-debug) .inside {
    font-size: 16px;
    line-height: 1.6;
    color: var(--pre-text);
}

body[class*='pre-realty']:not(.pre-realty_page_pre-debug) h2 {
    font-size: 24px;
    font-weight: 400;
    color: var(--pre-green);
    margin-bottom: 20px;
}

/* Debug page - larger fonts */
body.pre-realty_page_pre-debug .wrap p,
body.pre-realty_page_pre-debug .wrap td,
body.pre-realty_page_pre-debug .wrap li,
body.pre-realty_page_pre-debug .inside {
    font-size: 18px;
    line-height: 1.6;
    color: var(--pre-text);
}

body.pre-realty_page_pre-debug h2 {
    font-size: var(--pre-h2);
    font-weight: 400;
    color: var(--pre-green);
    margin-bottom: 20px;
}

/* Dashboard Headings */
body[class*='pre-realty'] h1 {
    font-size: var(--pre-h1);
    font-weight: 300;
    color: var(--pre-green);
    margin-bottom: 30px;
}

body[class*='pre-realty'] h3 {
    font-size: var(--pre-h3);
    font-weight: 400;
    color: var(--pre-green);
}

/* Card Headers */
body[class*='pre-realty'] .postbox-header h2,
body[class*='pre-realty'] .hndle {
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

/* Labels */
body[class*='pre-realty'] label {
    font-size: 16px;
    font-weight: 500;
    color: var(--pre-text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ================================
   FORM ELEMENTS BASE - SCOPED
   ================================ */

.pre-content-area input,
.pre-content-area textarea,
.pre-content-area select,
.pre-content-area button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    margin: 0;
}

.pre-content-area input,
.pre-content-area textarea,
.pre-content-area select {
    background: var(--pre-glass);
    border: 1px solid var(--pre-glass-border);
    color: var(--pre-white);
    border-radius: var(--pre-radius-sm);
    padding: var(--pre-space-3) var(--pre-space-4);
    transition: var(--pre-transition);
}

.pre-content-area input:focus,
.pre-content-area textarea:focus,
.pre-content-area select:focus {
    outline: none;
    border-color: var(--pre-green);
    box-shadow: 0 0 0 2px rgba(58, 178, 74, 0.2);
}

.pre-content-area input::placeholder,
.pre-content-area textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* ================================
   SCROLLBARS - SCOPED TO PREVENT CONFLICTS
   ================================ */

.pre-content-area ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.pre-content-area ::-webkit-scrollbar-track {
    background: var(--pre-black-soft);
    border-radius: var(--pre-radius-sm);
}

.pre-content-area ::-webkit-scrollbar-thumb {
    background: var(--pre-green);
    border-radius: var(--pre-radius-sm);
}

.pre-content-area ::-webkit-scrollbar-thumb:hover {
    background: var(--pre-green-light);
}

.pre-content-area ::-webkit-scrollbar-corner {
    background: var(--pre-black-soft);
}

/* Firefox scrollbars - scoped */
.pre-content-area {
    scrollbar-width: thin;
    scrollbar-color: var(--pre-green) var(--pre-black-soft);
}

/* ================================
   SELECTION - SCOPED TO PREVENT CONFLICTS
   ================================ */

.pre-content-area ::selection {
    background: rgba(58, 178, 74, 0.3);
    color: var(--pre-white);
}

.pre-content-area ::-moz-selection {
    background: rgba(58, 178, 74, 0.3);
    color: var(--pre-white);
}

/* ================================
   FOCUS MANAGEMENT - SCOPED TO PREVENT CONFLICTS
   ================================ */

.pre-content-area :focus {
    outline: 2px solid var(--pre-green);
    outline-offset: 2px;
}

.pre-content-area :focus:not(:focus-visible) {
    outline: none;
}

.pre-content-area :focus-visible {
    outline: 2px solid var(--pre-green);
    outline-offset: 2px;
}

/* ================================
   PRINT STYLES
   ================================ */

@media print {
    /* Body override for print - needs to override dark theme */
    body {
        background: white;
        color: black;
    }

    /* Card styles for print */
    .pre-card {
        border: 1px solid #ccc;
        background: white;
    }

    /* Title styles for print - remove gradient effects */
    .pre-title {
        color: black;
        background: none;
        -webkit-text-fill-color: black;
    }
}

/* ================================
   REDUCED MOTION - SCOPED TO PREVENT CONFLICTS
   ================================ */

@media (prefers-reduced-motion: reduce) {
    .pre-content-area *,
    .pre-content-area *::before,
    .pre-content-area *::after {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
        scroll-behavior: auto;
    }
}
