/* Responsive Mobile Styles for Soulcare Website */

/* General Responsive Adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    p {
        font-size: 1rem;
    }

    .container {
        padding: 0 15px;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .section-header h2 {
        padding: 0 10px;
    }
}

/* Mobile Navigation Adjustments */
@media (max-width: 1024px) {
    .nav-menu {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    /* Enhanced Hamburger Button */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        background-color: var(--soft-blue);
        border: none;
        border-radius: 5px;
        cursor: pointer;
        padding: 8px;
        z-index: 1001;
        position: relative;
        margin-right: 5px;
    }

    .nav-toggle:hover {
        background-color: var(--primary-blue);
    }

    .nav-toggle:hover .bar {
        background-color: white;
    }

    .nav-toggle .bar {
        width: 25px;
        height: 3px;
        background-color: var(--primary-blue);
        border-radius: 3px;
        transition: all 0.3s ease;
        margin: 3px 0;
    }

    .nav-toggle.active {
        background-color: var(--primary-blue);
    }

    .nav-toggle.active .bar {
        background-color: white;
    }

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

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

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

    /* Mobile Menu Improved */
    #mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--bg-tertiary);
        z-index: 999;
        transition: all 0.3s ease;
        padding-top: 80px;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
    }

    #mobile-menu.active {
        left: 0;
    }

    #mobile-menu ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    #mobile-menu li {
        border-bottom: 1px solid var(--border-color);
    }

    #mobile-menu .nav-link {
        display: block;
        padding: 15px 20px;
        font-size: 1.1rem;
        color: var(--text-primary);
        text-decoration: none;
        transition: all 0.3s ease;
    }

    #mobile-menu .nav-link:hover {
        background-color: var(--soft-blue);
        color: var(--primary-blue);
    }

    #mobile-menu .cta-button {
        margin: 20px;
        text-align: center;
        display: inline-block;
    }

    /* Prevent body scroll when menu is open */
    body.mobile-menu-open {
        overflow: hidden !important;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    /* Overlay when mobile menu is open */
    body.mobile-menu-open::after {
        content: "";
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 80%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    .nav-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0 15px;
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background-color: var(--bg-tertiary);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
}

/* Hero Section Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 100px 0 60px;
        min-height: auto;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-image {
        order: -1;
    }

    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

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

/* Welcome Section Responsive */
@media (max-width: 768px) {
    .welcome {
        padding: 60px 0;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .stat-item {
        padding: 1.5rem;
    }

    .stat-item i {
        font-size: 2.5rem;
    }

    .stat-item h3 {
        font-size: 2rem;
    }
}

/* About Section Responsive */
@media (max-width: 768px) {
    .about {
        padding: 60px 0;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-text {
        order: 2;
    }

    .about-image {
        order: 1;
    }

    .about-image img {
        width: 100%;
        height: auto;
        margin: 0 auto;
        display: block;
    }

    .approach-list li {
        font-size: 1rem;
    }
}

/* Team Section Responsive */
@media (max-width: 768px) {
    .team-section h3 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    .team-grid-compact {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .team-member-compact {
        padding: 1rem;
    }

    .member-avatar img {
        width: 80px;
        height: 80px;
    }

    .team-member-compact h4 {
        font-size: 0.9rem;
    }

    .member-specialty {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .team-grid-compact {
        grid-template-columns: 1fr;
    }

    .member-popup .popup-content {
        flex-direction: column;
        padding: 1rem;
    }

    .popup-info ul {
        padding-left: 1rem;
        text-align: left;
    }
}

/* Services Section Responsive */
@media (max-width: 768px) {
    .services {
        padding: 60px 0;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .service-card {
        padding: 1.5rem;
        margin-bottom: 0;
    }
}

/* Resources Section Responsive */
@media (max-width: 768px) {
    .resources {
        padding: 60px 0;
    }

    .resources-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .resource-card {
        padding: 1.5rem;
    }
}

/* Testimonials Section Responsive */
@media (max-width: 768px) {
    .testimonials {
        padding: 60px 0;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .testimonial-card {
        padding: 1.5rem;
    }
}

/* Contact Section Responsive */
@media (max-width: 768px) {
    .contact {
        padding: 60px 0;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .contact-info {
        order: 2;
        width: 100%;
        max-width: 100%;
    }

    .contact-form {
        order: 1;
        width: 100%;
    }

    .contact-item {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        width: 100%;
        margin-bottom: 1.5rem;
        box-sizing: border-box;
    }

    .contact-item i {
        flex-shrink: 0;
        font-size: 1.2rem;
        margin-right: 15px;
        margin-top: 5px;
        color: var(--primary-blue);
    }

    .contact-item div {
        flex: 1;
        width: calc(100% - 30px);
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
    }

    .contact-item h4 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .contact-item p {
        font-size: 0.9rem;
    }

    .contact-item a {
        word-break: break-all;
    }

    .map-container {
        margin-top: 2rem;
        width: 100%;
        overflow: hidden;
    }

    .map-container iframe {
        width: 100% !important;
        height: 300px;
        border-radius: 10px;
    }
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer {
        padding: 60px 0 30px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-section {
        margin-bottom: 1.5rem;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

/* Accessibility Tools Responsive */
@media (max-width: 768px) {
    .accessibility-tools {
        bottom: 20px;
        right: 20px;
    }

    .accessibility-tools button {
        width: 40px;
        height: 40px;
    }

    .theme-toggle-fab {
        bottom: 80px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

/* Fix for any horizontal scrolling issues */
@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden;
        width: 100%;
    }

    /* Adjustments for various elements that might cause overflow */
    img {
        max-width: 100%;
        height: auto;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}