/* Paramount Real Estate - Premium Custom Styles */

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #B91C1C;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #991B1B;
}

/* Selection color */
::selection {
    background: #B91C1C;
    color: #fff;
}

/* Hero gradient overlay */
.hero-overlay {
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.88) 0%,
        rgba(15, 23, 42, 0.45) 50%,
        rgba(15, 23, 42, 0.75) 100%
    );
}

/* Property card hover effect */
.property-card {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
}
.property-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}
.property-card .card-image img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.property-card:hover .card-image img {
    transform: scale(1.08);
}

/* Image gallery lightbox */
.gallery-lightbox {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.gallery-lightbox.active {
    opacity: 1;
    visibility: visible;
}

/* Fade-in animation on scroll */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(16px);
}
.stagger-children.visible > *:nth-child(1) { animation: fadeInUp 0.5s ease 0.1s forwards; }
.stagger-children.visible > *:nth-child(2) { animation: fadeInUp 0.5s ease 0.2s forwards; }
.stagger-children.visible > *:nth-child(3) { animation: fadeInUp 0.5s ease 0.3s forwards; }
.stagger-children.visible > *:nth-child(4) { animation: fadeInUp 0.5s ease 0.4s forwards; }
.stagger-children.visible > *:nth-child(5) { animation: fadeInUp 0.5s ease 0.5s forwards; }
.stagger-children.visible > *:nth-child(6) { animation: fadeInUp 0.5s ease 0.6s forwards; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button shine effect */
.btn-shine {
    position: relative;
    overflow: hidden;
}
.btn-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg) translateX(-100%);
    transition: transform 0.6s ease;
}
.btn-shine:hover::after {
    transform: rotate(30deg) translateX(100%);
}

/* Form input focus styles */
input:focus, textarea:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15);
    border-color: #B91C1C;
}

/* Custom select arrow */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Video container aspect ratio */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}
.video-container video,
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Admin sidebar */
.admin-sidebar {
    transition: transform 0.3s ease;
}
@media (max-width: 1023px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
}

/* Property badge */
.status-badge {
    position: relative;
    overflow: hidden;
}
.status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
}

/* Image aspect ratio for property cards */
.aspect-property {
    aspect-ratio: 4 / 3;
}

/* Text balance for headings */
h1, h2, h3 {
    text-wrap: balance;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #B91C1C;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(185, 28, 28, 0.4);
    z-index: 50;
    border: none;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: #991B1B;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(185, 28, 28, 0.5);
}

/* Cookie consent banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f172a;
    border-top: 1px solid #1e293b;
    padding: 1.25rem;
    z-index: 50;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}
.cookie-banner.show {
    transform: translateY(0);
}
.cookie-banner .cookie-content {
    max-width: 80rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}
@media (min-width: 768px) {
    .cookie-banner .cookie-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* Page loader */
.page-loader {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.page-loader .loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #fee2e2;
    border-top-color: #B91C1C;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Button loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-top: -0.5rem;
    margin-left: -0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Additional scroll animations */
.scale-in {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.blur-in {
    opacity: 0;
    filter: blur(8px);
    transition: opacity 0.7s ease, filter 0.7s ease;
}
.blur-in.visible {
    opacity: 1;
    filter: blur(0);
}

/* Pulse animation for featured badges */
@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(185, 28, 28, 0); }
}
.pulse-badge {
    animation: pulse-red 2s ease-in-out infinite;
}

/* Counter animation helper */
.counter-value {
    font-variant-numeric: tabular-nums;
}

/* Parallax container */
.parallax-bg {
    will-change: transform;
}

/* Image hover zoom container */
.img-zoom-container {
    overflow: hidden;
}
.img-zoom-container img {
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.img-zoom-container:hover img {
    transform: scale(1.1);
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 0.375rem 0.75rem;
    background: #0f172a;
    color: #fff;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* Smooth image loading */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}
img[data-src] {
    opacity: 0;
}

/* Print styles */
@media print {
    header, footer, .no-print, .back-to-top, .cookie-banner {
        display: none !important;
    }
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
}
