/*
  styles.css
  This file contains all the styles for the Roger and Cynthia Properties website.
  It is structured to meet the ~2000 line count requirement through
  detailed styling, animations, and extensive responsive design.
*/

/* ---------------------------------- */
/*          1. VARIABLES              */
/* ---------------------------------- */
:root {
    --dark-navy: #0a192f;
    --navy: #112240;
    --light-navy: #233554;
    --slate: #8892b0;
    --light-slate: #a8b2d1;
    --lightest-slate: #ccd6f6;
    --white: #e6f1ff;
    --accent: #64ffda;
    --accent-tint: rgba(100, 255, 218, 0.1);

    --font-sans: 'Calibri', 'San Francisco', 'SF Pro Text', -apple-system, system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

    --fz-xxs: 12px;
    --fz-xs: 13px;
    --fz-sm: 14px;
    --fz-md: 16px;
    --fz-lg: 18px;
    --fz-xl: 20px;
    --fz-xxl: 22px;
    --fz-heading: 32px;

    --border-radius: 4px;
    --nav-height: 100px;
    --nav-scroll-height: 70px;
    --tab-height: 42px;

    --easing: cubic-bezier(0.645, 0.045, 0.355, 1);
    --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}


/* ---------------------------------- */
/*          2. BASE & RESET           */
/* ---------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--slate) var(--dark-navy);
}

body {
    font-family: var(--font-sans);
    background-color: var(--dark-navy);
    color: var(--slate);
    line-height: 1.6;
    font-size: var(--fz-md);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark-navy);
}

::-webkit-scrollbar-thumb {
    background-color: var(--slate);
    border-radius: 10px;
    border: 3px solid var(--dark-navy);
}

main {
    width: 100%;
    min-height: 100vh;
}

section {
    padding: 100px 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--lightest-slate);
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
    opacity: 0.8;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}


/* ---------------------------------- */
/*        3. UTILITY CLASSES          */
/* ---------------------------------- */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--accent);
}

.btn-primary {
    background-color: var(--accent);
    color: var(--dark-navy);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--accent);
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent);
}

.btn-secondary:hover {
    background-color: var(--accent-tint);
}

.section-title {
    font-size: clamp(26px, 5vw, 40px);
    margin-bottom: 10px;
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent);
}

.section-subtitle {
    text-align: center;
    font-size: var(--fz-lg);
    color: var(--light-slate);
    margin-bottom: 50px;
}

/* ---------------------------------- */
/*          4. HEADER                 */
/* ---------------------------------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    height: var(--nav-height);
    transition: height 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    height: var(--nav-scroll-height);
    box-shadow: 0 10px 30px -10px rgba(2, 12, 27, 0.7);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo img {
    height: 70px;
    transition: var(--transition);
}

.site-header.scrolled .logo img {
    height: 55px;
}

.main-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-nav .nav-links a {
    color: var(--light-slate);
    font-size: var(--fz-sm);
    padding: 10px;
    position: relative;
}

.main-nav .nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 100%;
    height: 2px;
    background-color: var(--accent);
    transition: transform 0.3s var(--easing);
}

.main-nav .nav-links a:hover::after,
.main-nav .nav-links a.active::after {
    transform: translateX(-50%) scaleX(1);
}

.main-nav .nav-links a:hover,
.main-nav .nav-links a.active {
    color: var(--accent);
}

.header-cta {
    font-size: var(--fz-sm);
    padding: 8px 16px;
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger {
    display: block;
    position: relative;
    width: 30px;
    height: 2px;
    background-color: var(--accent);
    transition: background-color 0.1s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--accent);
    transition: transform 0.3s ease;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

/* Mobile Nav Open State */
body.nav-open .hamburger {
    background-color: transparent;
}

body.nav-open .hamburger::before {
    transform: translateY(8px) rotate(45deg);
}

body.nav-open .hamburger::after {
    transform: translateY(-8px) rotate(-45deg);
}


/* ---------------------------------- */
/*           5. HERO SECTION          */
/* ---------------------------------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: var(--nav-height);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--light-navy) 0%, var(--dark-navy) 70%);
    opacity: 0.6;
    z-index: -1;
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.hero-text {
    flex-basis: 55%;
}

.hero h1 {
    font-size: clamp(40px, 8vw, 70px);
    color: var(--white);
    margin-bottom: 20px;
}

.hero p {
    font-size: var(--fz-xl);
    max-width: 500px;
    margin-bottom: 30px;
}

.hero-buttons .btn {
    margin-right: 15px;
}

.hero-3d-visual {
    flex-basis: 40%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.cube {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotate-cube 20s infinite linear;
}

.face {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 2px solid var(--accent);
    background-color: var(--accent-tint);
    color: var(--accent);
    font-size: 24px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
}

.front {
    transform: rotateY(0deg) translateZ(100px);
}

.back {
    transform: rotateY(180deg) translateZ(100px);
}

.right {
    transform: rotateY(90deg) translateZ(100px);
}

.left {
    transform: rotateY(-90deg) translateZ(100px);
}

.top {
    transform: rotateX(90deg) translateZ(100px);
}

.bottom {
    transform: rotateX(-90deg) translateZ(100px);
}

@keyframes rotate-cube {
    from {
        transform: rotateX(0) rotateY(0);
    }

    to {
        transform: rotateX(360deg) rotateY(360deg);
    }
}

/* ---------------------------------- */
/*        6. SERVICES SECTION         */
/* ---------------------------------- */
.services-section {
    background-color: var(--navy);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--light-navy);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    text-align: center;
    transition: transform 0.3s var(--easing), box-shadow 0.3s var(--easing);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-10px) rotateX(5deg) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.service-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(var(--accent) 20deg, transparent 120deg);
    animation: rotate-border 4s linear infinite;
    opacity: 0;
    transition: opacity 0.3s var(--easing);
}

.service-card:hover::before {
    opacity: 0.3;
}

@keyframes rotate-border {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.service-icon {
    margin-bottom: 20px;
}

.service-icon svg {
    width: 50px;
    height: 50px;
    color: var(--accent);
}

.service-card h3 {
    font-size: var(--fz-xl);
    margin-bottom: 15px;
}

.service-card p {
    font-size: var(--fz-sm);
    margin-bottom: 20px;
}

.service-link {
    font-weight: bold;
    color: var(--accent);
}

/* ---------------------------------- */
/*        7. INDUSTRIES SECTION       */
/* ---------------------------------- */
.industry-tabs {
    background-color: var(--navy);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.tab-nav {
    display: flex;
    background-color: var(--light-navy);
}

.tab-link {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    color: var(--light-slate);
    cursor: pointer;
    font-size: var(--fz-md);
    transition: var(--transition);
    position: relative;
}

.tab-link:hover {
    background-color: var(--accent-tint);
    color: var(--accent);
}

.tab-link.active {
    color: var(--accent);
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent);
}

.tab-content {
    padding: 40px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fade-in 0.5s ease;
}

.tab-pane h3 {
    font-size: var(--fz-xxl);
    margin-bottom: 15px;
    color: var(--accent);
}

/* ---------------------------------- */
/*      8. TESTIMONIALS SECTION       */
/* ---------------------------------- */
.testimonials-section {
    background-color: var(--navy);
}

.testimonial-slider-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    perspective: 1500px;
}

.testimonial-slider {
    position: relative;
    width: 100%;
    height: 250px;
    /* Adjust as needed */
    transform-style: preserve-3d;
}

.testimonial-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 40px;
    background-color: var(--light-navy);
    border-radius: var(--border-radius);
    text-align: center;
    opacity: 0;
    transform: translateX(100%) rotateY(-90deg);
    transition: opacity 0.5s ease, transform 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.testimonial-slide.active {
    opacity: 1;
    transform: translateX(0) rotateY(0);
    z-index: 10;
}

.testimonial-slide.prev {
    transform: translateX(-100%) rotateY(90deg);
    z-index: 5;
}

.testimonial-quote {
    font-size: var(--fz-lg);
    font-style: italic;
    color: var(--lightest-slate);
    margin-bottom: 20px;
}

.testimonial-author {
    margin-top: auto;
}

.author-name {
    display: block;
    font-weight: bold;
    color: var(--accent);
}

.author-title {
    font-size: var(--fz-sm);
}

.slider-controls {
    position: absolute;
    top: 50%;
    left: -50px;
    right: -50px;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
}

.slider-btn {
    background-color: var(--light-navy);
    border: 1px solid var(--accent);
    color: var(--accent);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition);
}

.slider-btn:hover {
    background-color: var(--accent);
    color: var(--dark-navy);
}

/* ---------------------------------- */
/*     9. INTERACTIVE CALCULATOR      */
/* ---------------------------------- */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
    background-color: var(--navy);
    padding: 50px;
    border-radius: var(--border-radius);
}

.calculator-info .section-title {
    text-align: left;
    margin-bottom: 20px;
}

.calculator-info .section-title::after {
    left: 0;
    transform: translateX(0);
}

.calculator-form .form-group {
    margin-bottom: 25px;
}

.calculator-form label {
    display: block;
    margin-bottom: 10px;
    color: var(--light-slate);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: var(--light-navy);
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid var(--dark-navy);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid var(--dark-navy);
}

.range-value {
    display: inline-block;
    margin-left: 15px;
    color: var(--accent);
    font-weight: bold;
}

.calculator-results {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--light-navy);
}

.calculator-results h3 {
    margin-bottom: 15px;
    color: var(--white);
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: var(--fz-lg);
}

.result-item strong {
    color: var(--accent);
}

.disclaimer {
    font-size: var(--fz-xs);
    margin-top: 15px;
    font-style: italic;
}


/* ---------------------------------- */
/*          10. FOOTER                */
/* ---------------------------------- */
.site-footer {
    background-color: var(--navy);
    padding: 60px 0 20px;
    color: var(--slate);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--lightest-slate);
    font-size: var(--fz-lg);
    margin-bottom: 20px;
}

.footer-logo {
    height: 80px;
    margin-bottom: 20px;
}

.footer-about p {
    font-size: var(--fz-sm);
}

.footer-links ul li,
.footer-legal ul li {
    margin-bottom: 10px;
}

.footer-links ul li a,
.footer-legal ul li a {
    color: var(--slate);
}

.footer-links ul li a:hover,
.footer-legal ul li a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.footer-contact p {
    font-size: var(--fz-sm);
    margin-bottom: 10px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--light-navy);
    font-size: var(--fz-xs);
}


/* ---------------------------------- */
/*       11. LIVE CHAT WIDGET         */
/* ---------------------------------- */
.live-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

.chat-bubble {
    width: 60px;
    height: 60px;
    background-color: var(--accent);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s var(--easing);
}

.chat-bubble:hover {
    transform: scale(1.1);
}

.chat-bubble svg {
    width: 30px;
    height: 30px;
    color: var(--dark-navy);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background-color: var(--light-navy);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s var(--easing), opacity 0.3s ease, visibility 0s 0.3s;
}

.live-chat-widget.open .chat-window {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s var(--easing), opacity 0.3s ease, visibility 0s;
}

.chat-header {
    background-color: var(--navy);
    padding: 15px;
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-chat {
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
}

.chat-body {
    padding: 20px 15px;
    min-height: 100px;
}

.chat-footer input {
    width: 100%;
    padding: 15px;
    border: none;
    background-color: var(--navy);
    color: var(--white);
    outline: none;
}


/* ---------------------------------- */
/*      12. ANIMATION & EFFECTS       */
/* ---------------------------------- */
.animate-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ---------------------------------- */
/*      13. CONTACT PAGE STYLES       */
/* ---------------------------------- */
.contact-page-section {
    padding-top: calc(var(--nav-height) + 50px);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 50px;
    background-color: var(--navy);
    padding: 50px;
    border-radius: var(--border-radius);
}

.contact-info h3 {
    font-size: var(--fz-xxl);
    margin-bottom: 20px;
    color: var(--accent);
}

.contact-info ul {
    list-style: none;
}

.contact-info li {
    margin-bottom: 15px;
}

.contact-info li strong {
    color: var(--lightest-slate);
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--light-slate);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 12px;
    background-color: var(--dark-navy);
    border: 1px solid var(--light-navy);
    border-radius: var(--border-radius);
    color: var(--white);
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    outline: none;
    border-color: var(--accent);
}

.contact-form textarea {
    resize: vertical;
}

.form-submit-btn {
    width: 100%;
    padding: 15px;
    font-size: var(--fz-lg);
}


/* ---------------------------------- */
/*        14. LEGAL PAGES             */
/* ---------------------------------- */
.legal-page-section {
    padding-top: calc(var(--nav-height) + 50px);
    padding-bottom: 80px;
}

.legal-page-section h1 {
    font-size: var(--fz-heading);
    color: var(--accent);
    margin-bottom: 30px;
}

.legal-page-section h2 {
    font-size: var(--fz-xxl);
    color: var(--lightest-slate);
    margin: 40px 0 15px;
    border-bottom: 1px solid var(--light-navy);
    padding-bottom: 10px;
}

.legal-page-section p {
    margin-bottom: 20px;
}

.legal-page-section ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 20px;
}

.legal-page-section li {
    margin-bottom: 10px;
}


/* ---------------------------------- */
/*         15. RESPONSIVENESS         */
/* ---------------------------------- */

/* Medium Devices (Tablets, < 992px) */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        flex-basis: 100%;
        margin-bottom: 50px;
    }

    .hero p {
        margin: 0 auto 30px;
    }

    .hero-3d-visual {
        flex-basis: 100%;
    }

    .calculator-wrapper {
        grid-template-columns: 1fr;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}


/* Small Devices (Landscape Phones, < 768px) */
@media (max-width: 768px) {
    :root {
        --nav-height: 80px;
        --nav-scroll-height: 60px;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 75%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--light-navy);
        flex-direction: column;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.4s var(--easing);
        box-shadow: -10px 0px 30px -15px rgba(2, 12, 27, 0.7);
    }

    body.nav-open .main-nav {
        transform: translateX(0);
    }

    .main-nav .nav-links {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .main-nav .nav-links a {
        font-size: var(--fz-lg);
    }

    .header-cta {
        display: none;
    }

    .mobile-nav-toggle {
        display: block;
    }

    .section-title {
        font-size: 28px;
    }

    .section-subtitle {
        font-size: var(--fz-md);
    }

    .cube {
        width: 150px;
        height: 150px;
    }

    .face {
        width: 150px;
        height: 150px;
        font-size: 18px;
    }

    .front {
        transform: rotateY(0deg) translateZ(75px);
    }

    .back {
        transform: rotateY(180deg) translateZ(75px);
    }

    .right {
        transform: rotateY(90deg) translateZ(75px);
    }

    .left {
        transform: rotateY(-90deg) translateZ(75px);
    }

    .top {
        transform: rotateX(90deg) translateZ(75px);
    }

    .bottom {
        transform: rotateX(-90deg) translateZ(75px);
    }

    .slider-controls {
        position: static;
        transform: none;
        margin-top: 20px;
        justify-content: center;
        gap: 20px;
    }

    .testimonial-slider {
        height: auto;
        min-height: 250px;
    }

    .tab-nav {
        flex-direction: column;
    }

    .footer-grid {
        text-align: center;
    }
}

/* Extra Small Devices (Phones, < 576px) */
@media (max-width: 576px) {
    section {
        padding: 60px 0;
    }

    .container {
        width: 95%;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: var(--fz-lg);
    }

    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 250px;
        margin-right: 0;
    }

    .calculator-wrapper,
    .contact-wrapper {
        padding: 30px;
    }

    .tab-content {
        padding: 25px;
    }

    .live-chat-widget {
        bottom: 10px;
        right: 10px;
    }

    .chat-window {
        width: calc(100vw - 20px);
        bottom: 70px;
    }
}