/* Avroo's Abode - Light/Dark Theme System */

/* ===== THEME VARIABLES ===== */
:root {
    /* Primary Brand Colors (Gold) - Same for both themes */
    --theme-primary: #D4AF37;
    --theme-primary-dark: #B8860B;
    --theme-primary-light: #F4D03F;
    --theme-primary-rgb: 212, 175, 55;
    
    /* Default to Dark Theme */
    --theme-bg: #0a0a0a;
    --theme-bg-secondary: #111111;
    --theme-bg-card: #1a1a1a;
    --theme-bg-hover: #222222;
    --theme-text: #ffffff;
    --theme-text-secondary: #9a9a9a;
    --theme-text-muted: #666666;
    --theme-border: rgba(212, 175, 55, 0.15);
    --theme-border-light: rgba(255, 255, 255, 0.1);
    --theme-shadow: rgba(0, 0, 0, 0.3);
    --theme-overlay: rgba(10, 10, 10, 0.95);
    
    /* Component specific */
    --theme-header-bg: rgba(10, 10, 10, 0.95);
    --theme-footer-bg: #0a0a0a;
    --theme-card-bg: #111111;
    --theme-input-bg: #1a1a1a;
    --theme-btn-text: #0a0a0a;
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
    --theme-bg: #ffffff;
    --theme-bg-secondary: #f8f9fa;
    --theme-bg-card: #ffffff;
    --theme-bg-hover: #f0f0f0;
    --theme-text: #1a1a1a;
    --theme-text-secondary: #666666;
    --theme-text-muted: #999999;
    --theme-border: rgba(212, 175, 55, 0.2);
    --theme-border-light: rgba(0, 0, 0, 0.1);
    --theme-shadow: rgba(0, 0, 0, 0.1);
    --theme-overlay: rgba(255, 255, 255, 0.95);
    
    /* Component specific */
    --theme-header-bg: rgba(255, 255, 255, 0.95);
    --theme-footer-bg: #1a1a1a;
    --theme-card-bg: #ffffff;
    --theme-input-bg: #f8f9fa;
    --theme-btn-text: #ffffff;
    
    /* Override template ul- variables for light mode */
    --ul-text-light: #1a1a1a;
    --ul-bg-dark: #f8f9fa;
    --ul-bg-card: #ffffff;
    --ul-gray2: #666666;
}

/* ===== DARK THEME (explicit) ===== */
[data-theme="dark"] {
    --ul-text-light: #ffffff;
    --ul-bg-dark: #0a0a0a;
    --ul-bg-card: #1a1a1a;
    --ul-gray2: #a0a0a0;
}

/* ===== CRITICAL BODY FIXES ===== */
body {
    overflow: auto !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
    background-color: var(--theme-bg) !important;
    color: var(--theme-text) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

html {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--theme-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(var(--theme-primary-rgb), 0.4);
    z-index: 9999;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(var(--theme-primary-rgb), 0.5);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    color: #0a0a0a;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(15deg);
}

/* Sun/Moon icons visibility */
[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg);
}

[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="light"] .theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="light"] .theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg);
}

/* ===== PRELOADER ===== */
.preloader {
    background: var(--theme-bg) !important;
}

/* ===== HEADER ===== */
.ul-header,
.ul-header-bottom {
    background-color: var(--theme-header-bg) !important;
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease;
}

.ul-header.sticky {
    background-color: var(--theme-header-bg) !important;
    box-shadow: 0 2px 20px var(--theme-shadow);
}

.ul-header-nav a {
    color: var(--theme-text) !important;
}

.ul-header-nav a:hover,
.ul-header-nav a.active {
    color: var(--theme-primary) !important;
}

.ul-header-actions button {
    color: var(--theme-text) !important;
    background: transparent;
    border: none;
}

.ul-header-actions button:hover {
    color: var(--theme-primary) !important;
}

/* Logo text */
.logo-text, 
.header-bottom-left span,
.ul-sidebar-header-logo span {
    color: var(--theme-primary) !important;
}

.logo-text span,
.header-bottom-left span span {
    color: var(--theme-text) !important;
}

/* ===== SUBMENU ===== */
.ul-header-submenu {
    background-color: var(--theme-card-bg) !important;
    border: 1px solid var(--theme-border);
    box-shadow: 0 10px 40px var(--theme-shadow);
}

.ul-header-submenu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ul-header-submenu li a {
    color: var(--theme-text) !important;
    display: block;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.ul-header-submenu li a:hover {
    color: var(--theme-primary) !important;
    background-color: var(--theme-bg-hover) !important;
}

/* ===== SIDEBAR ===== */
.ul-sidebar {
    background-color: var(--theme-card-bg) !important;
    box-shadow: -5px 0 30px var(--theme-shadow);
}

.ul-sidebar-descr {
    color: var(--theme-text-secondary) !important;
}

.ul-sidebar-closer {
    color: var(--theme-text) !important;
}

.ul-sidebar-footer-title {
    color: var(--theme-text) !important;
}

.ul-sidebar-footer-social a {
    background-color: var(--theme-bg-hover) !important;
    color: var(--theme-primary) !important;
    border: 1px solid var(--theme-border);
}

.ul-sidebar-footer-social a:hover {
    background-color: var(--theme-primary) !important;
    color: var(--theme-btn-text) !important;
}

/* ===== SEARCH MODAL ===== */
.ul-search-form-wrapper {
    background-color: var(--theme-overlay) !important;
}

.ul-search-form input {
    background: transparent !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-primary) !important;
}

.ul-search-closer {
    color: var(--theme-text) !important;
}

/* ===== MAIN CONTENT ===== */
main {
    background-color: var(--theme-bg);
}

/* ===== SECTIONS ===== */
section {
    background-color: var(--theme-bg);
}

.ul-section-sub-title {
    color: var(--theme-primary) !important;
}

.ul-section-title,
.ul-section-title-2 {
    color: var(--theme-text) !important;
}

/* ===== BANNER ===== */
.ul-banner {
    background-color: var(--theme-bg) !important;
}

.ul-banner-slide-title,
.ul-banner-slide-sub-title {
    color: var(--theme-text) !important;
}

.ul-banner-slide-descr {
    color: var(--theme-text-secondary) !important;
}

.ul-banner-slide-shadow-title {
    color: var(--theme-border-light) !important;
    opacity: 0.1;
}

/* ===== CARDS ===== */
.ul-project,
.ul-service,
.ul-featured-property,
.ul-blog-card,
.ul-contact-form-wrapper,
.ul-pricing-card,
.ul-testimonial {
    background-color: var(--theme-card-bg) !important;
    border: 1px solid var(--theme-border);
    transition: all 0.3s ease;
}

.ul-project:hover,
.ul-service:hover,
.ul-featured-property:hover,
.ul-blog-card:hover {
    border-color: var(--theme-primary);
    box-shadow: 0 10px 40px rgba(var(--theme-primary-rgb), 0.15);
}

/* Card Titles */
.ul-project-title,
.ul-service-title,
.ul-featured-property-title,
.ul-blog-card-title {
    color: var(--theme-text) !important;
}

.ul-project-title:hover,
.ul-service-title:hover,
.ul-featured-property-title:hover,
.ul-blog-card-title:hover {
    color: var(--theme-primary) !important;
}

/* Card Text */
.ul-project-location,
.ul-project-descr,
.ul-service-descr,
.ul-featured-property-location,
.ul-blog-card-descr {
    color: var(--theme-text-secondary) !important;
}

/* Price */
.ul-project-price .number,
.ul-featured-property-price .number {
    color: var(--theme-primary) !important;
}

.ul-project-price,
.ul-featured-property-price {
    color: var(--theme-text-secondary) !important;
}

/* Tags */
.ul-project-tag,
.ul-service-tag {
    background-color: var(--theme-primary) !important;
    color: var(--theme-btn-text) !important;
}

/* ===== HEADINGS ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--theme-text) !important;
}

p {
    color: var(--theme-text-secondary) !important;
}

/* ===== BUTTONS ===== */
.ul-btn,
.ul-btn-primary,
.add-property-btn {
    background-color: var(--theme-primary) !important;
    color: var(--theme-btn-text) !important;
    border-color: var(--theme-primary) !important;
    transition: all 0.3s ease;
}

.ul-btn:hover,
.ul-btn-primary:hover,
.add-property-btn:hover {
    background-color: var(--theme-primary-dark) !important;
    border-color: var(--theme-primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(var(--theme-primary-rgb), 0.3);
}

.ul-btn-outline {
    background-color: transparent !important;
    color: var(--theme-primary) !important;
    border: 2px solid var(--theme-primary) !important;
}

.ul-btn-outline:hover {
    background-color: var(--theme-primary) !important;
    color: var(--theme-btn-text) !important;
}

/* ===== FORMS ===== */
input,
textarea,
select,
.form-control,
.ss-main {
    background-color: var(--theme-input-bg) !important;
    border: 1px solid var(--theme-border) !important;
    color: var(--theme-text) !important;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus,
.form-control:focus {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.1) !important;
    background-color: var(--theme-bg) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--theme-text-muted) !important;
}

label {
    color: var(--theme-text) !important;
}

/* ===== STATS ===== */
.ul-stats {
    background-color: var(--theme-bg-secondary) !important;
}

.ul-stat-number {
    color: var(--theme-primary) !important;
}

.ul-stat-title {
    color: var(--theme-text) !important;
}

/* ===== TESTIMONIALS ===== */
.ul-testimonial-txt {
    color: var(--theme-text-secondary) !important;
}

.ul-testimonial-author-name {
    color: var(--theme-text) !important;
}

.ul-testimonial-author-designation {
    color: var(--theme-primary) !important;
}

/* ===== BREADCRUMB ===== */
.ul-breadcrumb {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.9) 0%, rgba(184, 134, 11, 0.95) 100%) !important;
    position: relative;
}

.ul-breadcrumb::before {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.9) 0%, rgba(184, 134, 11, 0.95) 100%) !important;
}

.ul-breadcrumb-title {
    color: #0a0a0a !important;
    text-shadow: none !important;
}

.ul-breadcrumb-nav {
    border-color: rgba(10, 10, 10, 0.3) !important;
}

.ul-breadcrumb-nav a {
    color: #0a0a0a !important;
}

.ul-breadcrumb-nav a:hover {
    color: #1a1a1a !important;
}

.ul-breadcrumb-nav .current-page {
    color: rgba(10, 10, 10, 0.7) !important;
}

.ul-breadcrumb .separator {
    color: rgba(10, 10, 10, 0.5) !important;
}

/* ===== FEATURED PROPERTIES SECTION (Always Dark Background) ===== */
/* This section maintains a dark background in both themes, so text stays light */
.ul-featured-properties-title-txt {
    color: #ffffff !important;
}

.ul-featured-properties-title-txt i {
    color: var(--ul-primary) !important;
}

.ul-featured-properties-slider-wrapper {
    border-color: rgba(255, 255, 255, 0.2) !important;
}

/* Featured Property Cards - Always visible text (not just on hover) */
.ul-project.ul-featured-property .ul-project-location,
.ul-project.ul-featured-property .ul-project-price,
.ul-project.ul-featured-property .ul-project-info {
    color: rgba(255, 255, 255, 0.85) !important;
}

.ul-project.ul-featured-property:hover .ul-project-location,
.ul-project.ul-featured-property:hover .ul-project-price,
.ul-project.ul-featured-property:hover .ul-project-info {
    color: var(--ul-gray2) !important;
}

/* ===== FOOTER (Always Dark) ===== */
.ul-footer {
    background-color: #0a0a0a !important;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.ul-footer-top {
    background-color: #0a0a0a !important;
}

.ul-footer-about-txt {
    color: rgba(255, 255, 255, 0.7) !important;
}

.ul-footer-widget-title {
    color: var(--theme-primary) !important;
}

.ul-footer-widget-links a {
    color: rgba(255, 255, 255, 0.7) !important;
}

.ul-footer-widget-links a:hover {
    color: var(--theme-primary) !important;
}

.ul-footer-socials a {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--theme-primary) !important;
}

.ul-footer-socials a:hover {
    background-color: var(--theme-primary) !important;
    color: #0a0a0a !important;
}

.ul-footer-bottom {
    background-color: #050505 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright-txt {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Light theme footer - keep it dark */
[data-theme="light"] .ul-footer,
[data-theme="light"] .ul-footer-top {
    background-color: #0a0a0a !important;
}

[data-theme="light"] .ul-footer-bottom {
    background-color: #050505 !important;
}

[data-theme="light"] .ul-footer-about-txt,
[data-theme="light"] .ul-footer-widget-links a {
    color: rgba(255, 255, 255, 0.7) !important;
}

[data-theme="light"] .copyright-txt {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ===== PAGINATION ===== */
.pagination .page-link {
    background-color: var(--theme-card-bg) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

.pagination .page-link:hover,
.pagination .page-item.active .page-link {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-btn-text) !important;
}

/* ===== FACILITIES ===== */
.ul-facility {
    background-color: var(--theme-card-bg) !important;
    border: 1px solid var(--theme-border);
}

.ul-facility-icon {
    color: var(--theme-primary) !important;
}

.ul-facility-title {
    color: var(--theme-text) !important;
}

.ul-facility-descr {
    color: var(--theme-text-secondary) !important;
}

/* ===== PARTNERS ===== */
.ul-partners {
    background-color: var(--theme-bg-secondary) !important;
}

/* ===== FILTER SEARCH ===== */
.ul-filter-search {
    background-color: var(--theme-card-bg) !important;
    border: 1px solid var(--theme-border);
}

/* ===== ACCORDION ===== */
.ul-single-accordion-item {
    background-color: var(--theme-card-bg) !important;
    border: 1px solid var(--theme-border) !important;
}

.ul-single-accordion-item__header {
    color: var(--theme-text) !important;
}

.ul-single-accordion-item__body {
    color: var(--theme-text-secondary) !important;
}

/* ===== PROPERTY PAGES CUSTOM STYLES ===== */
.property-card {
    background: var(--theme-card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--theme-border);
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(var(--theme-primary-rgb), 0.2);
    border-color: var(--theme-primary);
}

.property-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.property-gallery-main {
    grid-column: span 4;
    border-radius: 8px;
    overflow: hidden;
}

.property-gallery-thumb {
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.property-gallery-thumb:hover,
.property-gallery-thumb.active {
    opacity: 1;
}

/* ===== BACK TO TOP ===== */
.ul-back-to-top,
.back-to-top {
    background-color: var(--theme-primary) !important;
    color: var(--theme-btn-text) !important;
}

/* ===== ICONS ===== */
[class^="flaticon-"]:before,
[class*=" flaticon-"]:before {
    color: inherit;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .theme-toggle {
        bottom: 40%;
        left: 20px;
        width: 45px;
        height: 45px;
    }
    
    .property-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .property-gallery-main {
        grid-column: span 2;
    }
}

/* ===== SMOOTH TRANSITIONS FOR THEME SWITCH ===== */
*,
*::before,
*::after {
    transition: background-color 0.3s ease, 
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

/* Exclude specific elements from transition */
a, button, .ul-btn, img, svg {
    transition: all 0.3s ease;
}

/* ===== ADMIN BUTTON ===== */
.add-property-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
}

/* ===== SCROLL BAR STYLING ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--theme-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--theme-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--theme-primary-dark);
}
