/*
 * RS Security Systems - styles.css
 *
 * This file contains all the CSS styles for the website, organized
 * in the order that elements appear in the HTML document.
 */

/* ==========================================================================
   1. General Styles
   ========================================================================== */
:root {
    --primary-color: #fef1e4;
    --secondary-color: #3493ed;
    --button-color: #ff6210;
    --text-color: #333;
    --white-color: #fff;
    --shadow-light: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1,
h2,
h3 {
    color: #000;
    font-weight: 700;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

/* ==========================================================================
   2. Desktop Fixed WhatsApp Chat Popup (Desktop-only)
   ========================================================================== */
#whatsapp-chat-popup {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 300px;
    height: 400px;
    z-index: 999;
    animation: slideInUp 1s cubic-bezier(1, -0.06, 0.68, 0.82);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(1.25rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-container {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    border-radius: 0.75rem;
    box-shadow: 0 0.25rem 0.9375rem rgba(0, 0, 0, 0.2);
    overflow: hidden;
    margin: 0;
}

.chat-container a {
    text-decoration: none;
}

.header {
    background-color: #075e54;
    color: white;
    padding: 0.625rem 0.9375rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 25px;
}

.remove-chat {
    cursor: pointer;
    padding: 0px 7px;
    border: 2px solid white;
    border-radius: 50%;
}

.pf-left-aligned {
    display: flex;
    align-items: center;
}

.profile-pic {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    margin-right: 0.625rem;
    border: 0.125rem solid white;
}

.profile-name {
    font-weight: 600;
}

.header-icons {
    display: none;
}

.message-area {
    flex-grow: 1;
    padding: 1.25rem 0.625rem;
    overflow-y: auto;
    background-color: #e5ddd5;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    margin-bottom: 0.625rem;
    position: relative;
    word-wrap: break-word;
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.message p {
    margin: 0;
    line-height: 1.4;
}

.message.received {
    background-color: #fff;
    align-self: flex-start;
    margin-right: auto;
    border-top-left-radius: 0;
    animation-delay: 0.2s;
}

.message.received::before {
    content: '';
    position: absolute;
    top: 0;
    left: -0.625rem;
    border-style: solid;
    border-width: 0 0.625rem 0.625rem 0;
    border-color: transparent #fff transparent transparent;
}

.call-button {
    background-color: #25d366;
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    margin-top: 1rem;
    cursor: pointer;
    font-weight: bold;
    align-self: flex-start;
    animation: fadeInUp 0.5s ease-out forwards;
}

.call-button:hover {
    background-color: #128c7e;
}

.input-area {
    background-color: #f0f0f0;
    padding: 0.625rem 0.9375rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: #919191;
}

/* ==========================================================================
   3. Header & Navigation
   ========================================================================== */
.main-header {
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px var(--shadow-light);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.navbar img {
    border-radius: 3px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links li {
    border-radius: 5px;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.nav-links li:hover {
    background-color: var(--button-color);
}

.nav-links a {
    color: var(--white-color);
    text-decoration: none;
    font-weight: 600;
}

.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--white-color);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

/* ==========================================================================
   4. Main Content Sections
   ========================================================================== */

/* Hero Section */
.hero-section {
    padding-top: 5vh;
    background-color: var(--primary-color);
    min-height: calc(100vh - 4rem);
    box-sizing: border-box;
}

/* #home {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
} */

.hero-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.1rem;
}

#highlighted-text {
    background-color: var(--button-color);
    color: white;
}

.hero-image {
    flex: 1;
    text-align: right;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 20px var(--shadow-light);
}

/* About Section */
.about-section {
    padding: 4rem 0;
    background-color: var(--white-color);
    text-align: center;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Security Section */
.security-section {
    padding: 4rem 0;
    background-color: var(--secondary-color);
    color: var(--white-color);
}

.security-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.security-text {
    flex: 1;
}

.security-text h2 {
    color: var(--white-color);
}

.security-image {
    flex: 1;
    text-align: right;
}

.security-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 20px var(--shadow-light);
}

/* Collapse and Expand Feature CSS */
#security-content-wrapper {
    max-height: 120px;
    overflow: hidden;
    transition: max-height 0s ease-out;
    position: relative;
}

#security-content-wrapper::after {
    content: "";
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    height: 90px;
    background: linear-gradient(to top, rgba(52, 147, 237, 1), rgba(52, 147, 237, 0));
    pointer-events: none;
}

#security-content-wrapper.expanded {
    max-height: 1000px;
    overflow: visible;
}

#security-content-wrapper.expanded::after {
    display: none;
}

.tertiary-button {
    background: none;
    border: none;
    color: var(--white-color);
    text-decoration: underline;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.tertiary-button:hover {
    color: var(--button-color);
}

/* Services Section */
.services-section {
    padding: 6rem 0;
    background-color: var(--primary-color);
    text-align: center;
}

.services-intro {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.services-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--white-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px var(--shadow-light);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.service-card:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.contact-btn {
    margin-top: 30px;
}

/* ==========================================================================
   5. Footer
   ========================================================================== */
.main-footer {
    background-color: #222;
    color: #ccc;
    padding: 4rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: var(--button-color);
    margin-bottom: 1.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--white-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #444;
}

/* ==========================================================================
   6. Buttons
   ========================================================================== */
.primary-button,
.secondary-button,
.footer-contact-button {
    display: inline-block;
    background-color: var(--button-color);
    color: var(--white-color);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.primary-button:hover,
.secondary-button:hover,
.footer-contact-button:hover {
    background-color: #d1500f;
    transform: translateY(-3px);
}

.secondary-button {
    margin-top: 1rem;
}

/* ==========================================================================
   7. Media Queries (Mobile-specific styles)
   ========================================================================== */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0px;
        height: 100%;
    }

    .hero-content {
        flex-direction: column-reverse;
    }

    /* Hide the chat popup and show the mobile buttons on smaller screens */
    #whatsapp-chat-popup {
        display: none;
    }

    .mobile-fixed-buttons {
        display: flex;
        position: fixed;
        bottom: 20px;
        width: 100%;
        justify-content: space-between;
        padding: 0 20px;
        z-index: 1000;
    }

    .whatsapp-mobile,
    .call-mobile {
        color: var(--white-color);
        width: 60px;
        height: 60px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        font-size: 1.5rem;
        transition: transform 0.3s ease;
        text-decoration: none;
    }

    .whatsapp-mobile {
        background-color: #25d366;
    }

    .call-mobile {
        background-color: #006ac1;
    }

    .whatsapp-mobile:hover,
    .call-mobile:hover {
        transform: scale(1.1);
    }

    /* Mobile Navigation Specifics */
    .nav-links {
        display: none;
        position: absolute;
        top: 86px;
        left: 0;
        width: 100%;
        background-color: var(--secondary-color);
        flex-direction: column;
        text-align: center;
        padding: 1rem 0;
        box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
        z-index: 999;
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .nav-links.active {
        display: flex;
        transform: translateY(0);
    }

    .nav-links li {
        margin: 0.5rem 0;
        padding: 10px;
    }

    .hamburger {
        display: block;
    }

    /* Hamburger animation */
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* Hide mobile buttons on desktop */
@media (min-width: 769px) {
    .mobile-fixed-buttons {
        display: none;
    }
}

@media (max-width: 335px) {
    .service-card {
        width: 85vw;
    }
}