/**
 * Max Property Finance - Base Styles
 * Core styles, variables, typography, buttons, forms
 * Version: 2.0.0 (Optimized)
 */

/* ==========================================================================
   CSS VARIABLES
   ========================================================================== */
:root {
    /* Brand Colors */
    --mpf-primary-color: #98b332;
    --mpf-primary-hover: #7a9028;
    --mpf-primary-light: #b8d362;
    --mpf-primary-dark: #6d801e;
    
    --mpf-secondary-color: #034d66;
    --mpf-secondary-hover: #023a4d;
    --mpf-secondary-light: #045d7d;
    --mpf-secondary-dark: #022e3d;
    
    /* Neutral Colors */
    --mpf-white: #ffffff;
    --mpf-black: #000000;
    --mpf-light-gray: #f8f9fa;
    --mpf-light-bg: #f8f9fa;
    --mpf-gray: #6c757d;
    --mpf-dark-gray: #333333;
    --mpf-text-color: #555555;
    --mpf-border-color: #dee2e6;
    
    /* Status Colors */
    --mpf-success: #28a745;
    --mpf-warning: #ffc107;
    --mpf-danger: #dc3545;
    --mpf-info: #17a2b8;
    
    /* Typography */
    --mpf-font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --mpf-font-size-base: 16px;
    --mpf-line-height-base: 1.6;
    --mpf-heading-font-weight: 700;
    
    /* Spacing */
    --mpf-spacing-xs: 0.25rem;
    --mpf-spacing-sm: 0.5rem;
    --mpf-spacing-md: 1rem;
    --mpf-spacing-lg: 1.5rem;
    --mpf-spacing-xl: 3rem;
    
    /* Border Radius */
    --mpf-border-radius: 0.375rem;
    --mpf-border-radius-lg: 0.5rem;
    
    /* Shadows */
    --mpf-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --mpf-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --mpf-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    /* Transitions */
    --mpf-transition-base: all 0.3s ease-in-out;
}

/* ==========================================================================
   BASE TYPOGRAPHY
   ========================================================================== */
body {
    font-family: var(--mpf-font-family);
    font-size: var(--mpf-font-size-base);
    line-height: var(--mpf-line-height-base);
    color: var(--mpf-text-color);
    background-color: var(--mpf-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: var(--mpf-heading-font-weight);
    color: var(--mpf-secondary-color);
    line-height: 1.3;
    margin-bottom: var(--mpf-spacing-md);
}

h1, .h1 { font-size: 2.5rem; }
h2, .h2 { font-size: 2rem; }
h3, .h3 { font-size: 1.75rem; }
h4, .h4 { font-size: 1.5rem; }
h5, .h5 { font-size: 1.25rem; }
h6, .h6 { font-size: 1rem; }

/* Responsive Typography Scaling */
@media (max-width: 767px) {
    h1, .h1 { font-size: 1.75rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.25rem; }
    h4, .h4 { font-size: 1.1rem; }
    h5, .h5 { font-size: 1rem; }
    h6, .h6 { font-size: 0.9rem; }
    
    body {
        font-size: 15px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    h1, .h1 { font-size: 2rem; }
    h2, .h2 { font-size: 1.75rem; }
    h3, .h3 { font-size: 1.5rem; }
    h4, .h4 { font-size: 1.3rem; }
    
    body {
        font-size: 15.5px;
    }
}

@media (min-width: 1400px) {
    h1, .h1 { font-size: 3rem; }
    h2, .h2 { font-size: 2.5rem; }
    h3, .h3 { font-size: 2rem; }
    
    body {
        font-size: 17px;
    }
}

p { margin-bottom: 1rem; }

/* ==========================================================================
   LINKS
   ========================================================================== */
a {
    color: var(--mpf-primary-color);
    text-decoration: none;
    transition: var(--mpf-transition-base);
}

a:hover,
a:focus {
    color: var(--mpf-primary-hover);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--mpf-primary-color);
    outline-offset: 2px;
}

/* ==========================================================================
   BUTTONS (Consolidated)
   ========================================================================== */
.btn {
    border-radius: var(--mpf-border-radius);
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    transition: var(--mpf-transition-base);
    border: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn i {
    transition: transform 0.3s ease;
}

.btn:hover i {
    transform: translateX(5px);
}

/* Primary Button */
.btn-primary {
    background-color: var(--mpf-primary-color);
    border-color: var(--mpf-primary-color);
    color: var(--mpf-white);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--mpf-primary-hover);
    border-color: var(--mpf-primary-hover);
    color: var(--mpf-white);
    transform: translateY(-2px);
    box-shadow: var(--mpf-shadow);
}

/* Secondary Button */
.btn-secondary {
    background-color: var(--mpf-secondary-color);
    border-color: var(--mpf-secondary-color);
    color: var(--mpf-white);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--mpf-secondary-hover);
    border-color: var(--mpf-secondary-hover);
    color: var(--mpf-white);
    transform: translateY(-2px);
    box-shadow: var(--mpf-shadow);
}

/* Outline Buttons */
.btn-outline-primary {
    border-color: var(--mpf-primary-color);
    color: var(--mpf-primary-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--mpf-primary-color);
    border-color: var(--mpf-primary-color);
    color: var(--mpf-white);
}

.btn-outline-secondary {
    border-color: var(--mpf-secondary-color);
    color: var(--mpf-secondary-color);
    background-color: transparent;
}

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

/* MPF Custom Button (Consolidated from btn-primary-mpf) */
.btn-mpf {
    background-color: transparent;
    border: 2px solid var(--mpf-primary-color);
    color: var(--mpf-primary-color);
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-mpf:hover {
    background-color: var(--mpf-primary-color);
    color: #fff;
}

/* Submit Button (Consolidated) */
.btn-submit {
    background-color: #8b9a2d;
    border: none;
    color: #fff;
    padding: 14px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.btn-submit:hover {
    background-color: #7a8928;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 154, 45, 0.3);
}

/* View All Button */
.btn-view-all {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: transparent;
    border: 2px solid var(--mpf-primary-color);
    color: var(--mpf-primary-color);
    padding: 14px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-view-all:hover {
    background-color: var(--mpf-primary-color);
    color: #fff;
}

/* CTA Button */
.btn-cta {
    background-color: #fff;
    color: var(--mpf-primary-color);
    padding: 14px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-cta:hover {
    background-color: var(--mpf-secondary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   FORMS (Consolidated)
   ========================================================================== */
.form-control,
.form-select {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 15px;
    color: #333;
    transition: all 0.3s ease;
    width: 100%;
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
    border-color: var(--mpf-primary-color);
    box-shadow: 0 0 0 3px rgba(152, 179, 50, 0.15);
    outline: none;
}

.form-control::placeholder {
    color: #999;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--mpf-secondary-color);
    margin-bottom: 8px;
    display: block;
}

.form-label span {
    color: #e74c3c;
}

/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */
.section-padding {
    padding: var(--mpf-spacing-xl) 0;
}

.section-padding-lg {
    padding: 5rem 0;
}

.bg-light-gray {
    background-color: var(--mpf-light-gray);
}

.text-primary {
    color: var(--mpf-primary-color) !important;
}

.text-secondary {
    color: var(--mpf-secondary-color) !important;
}

/* ==========================================================================
   RESPONSIVE IMAGES & MEDIA
   ========================================================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   RESPONSIVE CONTAINERS
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Overlay utility */
.overlay {
    position: relative;
}

.overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   WORDPRESS CORE CLASSES
   ========================================================================== */
.alignleft {
    float: left;
    margin-right: var(--mpf-spacing-md);
    margin-bottom: var(--mpf-spacing-md);
}

.alignright {
    float: right;
    margin-left: var(--mpf-spacing-md);
    margin-bottom: var(--mpf-spacing-md);
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--mpf-spacing-md);
}

.alignwide {
    max-width: 1200px;
}

.alignfull {
    max-width: 100%;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive Images */
img,
picture,
video,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
}

/* Responsive Tables */
table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

@media (min-width: 768px) {
    table {
        display: table;
    }
}

/* Responsive Embeds */
.embed-responsive {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
}

.embed-responsive::before {
    content: "";
    display: block;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.embed-responsive iframe,
.embed-responsive embed,
.embed-responsive object,
.embed-responsive video {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--mpf-light-gray);
    border-radius: var(--mpf-border-radius);
    box-shadow: var(--mpf-shadow);
    clip: auto !important;
    color: var(--mpf-secondary-color);
    display: block;
    font-size: 1rem;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--mpf-primary-color);
    color: var(--mpf-white);
    padding: 8px;
    text-decoration: none;
    z-index: 100001;
}

.skip-link:focus {
    top: 0;
    clip: auto;
    height: auto;
    width: auto;
    display: block;
    padding: 1rem;
    font-weight: bold;
}

/* Keyboard Navigation */
body.keyboard-navigation *:focus {
    outline: 2px solid var(--mpf-primary-color);
    outline-offset: 2px;
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--mpf-primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   ANIMATIONS (Consolidated - Single definitions)
   ========================================================================== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }

    img {
        page-break-inside: avoid;
    }

    h2, h3, p {
        orphans: 3;
        widows: 3;
    }

    h2, h3 {
        page-break-after: avoid;
    }
    
    .site-header,
    .site-footer,
    .hero-slider,
    #back-to-top,
    .social-share-buttons,
    .navigation {
        display: none !important;
    }
}

/* ==========================================================================
   RESPONSIVE UTILITY CLASSES
   ========================================================================== */
/* Hide on mobile */
@media (max-width: 767px) {
    .d-none-mobile {
        display: none !important;
    }
}

/* Hide on tablet */
@media (min-width: 768px) and (max-width: 991px) {
    .d-none-tablet {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 992px) {
    .d-none-desktop {
        display: none !important;
    }
}

/* Show only on mobile */
.d-block-mobile {
    display: none !important;
}

@media (max-width: 767px) {
    .d-block-mobile {
        display: block !important;
    }
}

/* Show only on tablet */
.d-block-tablet {
    display: none !important;
}

@media (min-width: 768px) and (max-width: 991px) {
    .d-block-tablet {
        display: block !important;
    }
}

/* Show only on desktop */
@media (min-width: 992px) {
    .d-block-desktop {
        display: block !important;
    }
}

/* Text alignment utilities */
@media (max-width: 767px) {
    .text-center-mobile {
        text-align: center !important;
    }
    
    .text-left-mobile {
        text-align: left !important;
    }
}

/* Spacing utilities */
@media (max-width: 767px) {
    .mb-mobile-0 {
        margin-bottom: 0 !important;
    }
    
    .mb-mobile-1 {
        margin-bottom: 0.5rem !important;
    }
    
    .mb-mobile-2 {
        margin-bottom: 1rem !important;
    }
    
    .mb-mobile-3 {
        margin-bottom: 1.5rem !important;
    }
    
    .mt-mobile-0 {
        margin-top: 0 !important;
    }
    
    .mt-mobile-1 {
        margin-top: 0.5rem !important;
    }
    
    .mt-mobile-2 {
        margin-top: 1rem !important;
    }
    
    .mt-mobile-3 {
        margin-top: 1.5rem !important;
    }
}

/* ==========================================================================
   DARK MODE SUPPORT (Optional)
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    body.dark-mode-enabled {
        --mpf-text-color: #e0e0e0;
        --mpf-white: #1a1a1a;
        --mpf-light-gray: #2a2a2a;
        --mpf-dark-gray: #e0e0e0;
        background-color: var(--mpf-white);
        color: var(--mpf-text-color);
    }
}


/* ==========================================================================
   PAGE HEADER SECTION - RESPONSIVE
   ========================================================================== */
.page-header-section {
    margin-top: 90px !important;
    padding: 4rem 0 !important;
}

.page-header-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.page-header-section .lead {
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.breadcrumbs {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

.breadcrumbs a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--mpf-primary-color);
    text-decoration: underline;
}

/* Large Desktop */
@media (min-width: 1400px) {
    .page-header-section {
        padding: 5rem 0 !important;
    }
    
    .page-header-section h1 {
        font-size: 3rem;
    }
    
    .page-header-section .lead {
        font-size: 1.25rem;
    }
}

/* Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .page-header-section {
        margin-top: 80px !important;
        padding: 4.5rem 0 !important;
    }
    
    .page-header-section h1 {
        font-size: 2.75rem;
    }
}

/* Laptop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .page-header-section {
        margin-top: 75px !important;
        padding: 4rem 0 !important;
    }
    
    .page-header-section h1 {
        font-size: 2.5rem;
    }
}

/* Tablet - matches body padding-top */
@media (min-width: 768px) and (max-width: 991px) {
    .page-header-section {
        margin-top: 75px !important;
        padding: 3.5rem 0 !important;
    }
    
    .page-header-section h1 {
        font-size: 2rem;
    }
    
    .page-header-section .lead {
        font-size: 1.0625rem;
    }
}

/* Mobile - matches body padding-top */
@media (max-width: 767px) {
    .page-header-section {
        margin-top: 70px !important;
        padding: 2.5rem 0 !important;
    }
    
    .page-header-section h1 {
        font-size: 1.75rem;
    }
    
    .page-header-section .lead {
        font-size: 0.9375rem;
    }
}

/* Small Mobile */
@media (max-width: 575px) {
    .page-header-section {
        margin-top: 70px !important;
        padding: 2rem 0 !important;
    }
    
    .page-header-section h1 {
        font-size: 1.5rem;
    }
    
    .page-header-section .lead {
        font-size: 0.875rem;
    }
    
    .breadcrumbs {
        font-size: 0.75rem;
    }
}
@media (min-width: 1200px) and (max-width: 1399px) {
    .page-header-section {
        margin-top: 80px !important;
    }
}
@media (min-width: 992px) and (max-width: 1199px) {
    .page-header-section {
        margin-top: 75px !important;
    }
}