/* Custom CSS for Asindi Marketing & Research */

/* ============================================
   Global Image Constraints - Prevent Overflow
   ============================================ */
img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Navigation Fixes - Prevent Overlapping
   ============================================ */
.navbar-nav {
    flex-wrap: wrap;
    padding: 0.5rem 0 !important;
}

.navbar-nav .nav-item {
    margin: 0 1px;
}

.navbar-nav .nav-link {
    padding: 0.5rem 0.6rem !important;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #DA9F5B !important;
}

@media (max-width: 1400px) {
    .navbar-nav .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.5rem !important;
    }
}

@media (max-width: 1200px) {
    .navbar-nav .nav-link {
        font-size: 0.75rem;
        padding: 0.5rem 0.4rem !important;
    }
}

@media (max-width: 992px) {
    .navbar-nav {
        flex-direction: column;
        width: 100%;
        padding: 1rem 0 !important;
    }
    
    .navbar-nav .nav-item {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        font-size: 1rem;
        display: block;
    }
    
    .navbar-nav .nav-item:last-child {
        border-bottom: none;
    }
}

/* ============================================
   Service Card Hover Effects
   ============================================ */
.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(218, 159, 91, 0.3);
}

.service-card img {
    transition: transform 0.3s ease;
}

.service-card:hover img {
    transform: scale(1.05);
}

/* ============================================
   Statistics Animations
   ============================================ */
.statistics-section {
    background: linear-gradient(135deg, #DA9F5B 0%, #33211D 100%);
    padding: 80px 0;
    color: white;
}

.stat-item {
    text-align: center;
    padding: 20px;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
    display: block;
}

.stat-label {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
}

.stat-item i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Testimonial Cards
   ============================================ */
.testimonial-card {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(218, 159, 91, 0.2);
}

.testimonial-rating {
    color: #ffc107;
}

.testimonial-text {
    font-style: italic;
    color: #555;
    margin-bottom: 20px;
    flex-grow: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
    margin-top: auto;
}

.testimonial-info {
    width: 100%;
}

.testimonial-info h5 {
    margin: 0;
    font-size: 1.1rem;
    color: #33211D;
}

/* ============================================
   FAQ Accordion
   ============================================ */
.faq-card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    overflow: hidden;
}

.faq-card .card-header {
    background: #fff;
    border: none;
    padding: 0;
}

.faq-btn {
    width: 100%;
    text-align: left;
    padding: 20px;
    color: #33211D;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    background: transparent;
}

.faq-btn:hover {
    color: #DA9F5B;
    text-decoration: none;
}

.faq-btn i {
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.faq-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.faq-card .card-body {
    padding: 20px;
    background: #f8f9fa;
    color: #555;
}

/* ============================================
   Blog Cards
   ============================================ */
.blog-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.blog-card img {
    flex-shrink: 0;
    max-width: 100%;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(218, 159, 91, 0.2);
}

.blog-image {
    width: 100%;
    max-width: 100%;
    height: 250px;
    min-height: 250px;
    object-fit: cover;
    display: block !important;
    overflow: hidden;
    opacity: 1 !important;
    visibility: visible !important;
}

.blog-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.blog-category {
    background: #DA9F5B;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.blog-date {
    color: #999;
}

.blog-title {
    font-size: 1.5rem;
    color: #33211D;
    margin-bottom: 15px;
    font-weight: 600;
}

.blog-excerpt {
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
}

.blog-categories {
    margin-bottom: 30px;
}

.blog-categories .btn {
    margin: 5px;
}

/* ============================================
   Case Study Cards
   ============================================ */
.case-study-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.case-study-card img {
    flex-shrink: 0;
    max-width: 100%;
}

.case-study-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(218, 159, 91, 0.2);
}

.case-study-image {
    width: 100%;
    max-width: 100%;
    height: 300px;
    min-height: 300px;
    object-fit: cover;
    display: block !important;
    overflow: hidden;
    opacity: 1 !important;
    visibility: visible !important;
}

.case-study-content {
    padding: 30px;
}

.case-study-category {
    display: inline-block;
    background: #DA9F5B;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.case-study-title {
    font-size: 1.8rem;
    color: #33211D;
    margin-bottom: 15px;
    font-weight: 600;
}

.case-study-description {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.case-study-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #DA9F5B;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   WhatsApp Float Button
   ============================================ */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 100px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    background-color: #20ba5a;
    transform: scale(1.1);
    color: #FFF;
    text-decoration: none;
}

.whatsapp-float i {
    margin-top: 5px;
}

/* ============================================
   Newsletter Form Improvements
   ============================================ */
.newsletter-form {
    position: relative;
}

.newsletter-form .form-control {
    border-radius: 50px 0 0 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.newsletter-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-form .form-control:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: #DA9F5B;
    color: white;
}

.newsletter-form .btn {
    border-radius: 0 50px 50px 0;
    border: 2px solid #DA9F5B;
    background: #DA9F5B;
    transition: all 0.3s ease;
}

.newsletter-form .btn:hover {
    background: #c88d4a;
    border-color: #c88d4a;
    transform: translateX(-2px);
}

/* ============================================
   Button Enhancements
   ============================================ */
.btn-primary {
    transition: all 0.3s ease;
    border-radius: 5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(218, 159, 91, 0.4);
}

.btn-outline-primary {
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
}

/* ============================================
   Mobile Optimization - Small Screens (320px - 576px)
   ============================================ */
@media (max-width: 576px) {
    /* Typography */
    h1.display-4 {
        font-size: 2rem !important;
    }
    
    h2.display-4 {
        font-size: 1.75rem !important;
    }
    
    h3 {
        font-size: 1.5rem !important;
    }
    
    h4 {
        font-size: 1.25rem !important;
    }
    
    /* Page Headers */
    .page-header {
        min-height: 250px !important;
    }
    
    .page-header h1 {
        font-size: 2rem !important;
        padding: 0 15px;
    }
    
    /* Statistics Section */
    .statistics-section {
        padding: 40px 0 !important;
    }
    
    .stat-item {
        padding: 15px 10px !important;
        margin-bottom: 20px;
    }
    
    .stat-number {
        font-size: 2rem !important;
    }
    
    .stat-label {
        font-size: 0.85rem !important;
        letter-spacing: 1px;
    }
    
    .stat-item i {
        font-size: 2rem !important;
        margin-bottom: 10px;
    }
    
    /* Service Cards */
    .service-card {
        margin-bottom: 20px;
    }
    
    .service-card:hover {
        transform: none; /* Disable hover on mobile */
    }
    
    /* Testimonial Cards */
    .testimonial-card {
        padding: 20px !important;
        margin-bottom: 20px;
    }
    
    .testimonial-text {
        font-size: 0.95rem;
    }
    
    .testimonial-info h5 {
        font-size: 1rem;
    }
    
    /* Blog Cards */
    .blog-card {
        margin-bottom: 25px;
    }
    
    .blog-image {
        height: 200px !important;
        min-height: 200px !important;
        max-width: 100% !important;
        width: 100% !important;
        object-fit: cover !important;
    }
    
    .blog-content {
        padding: 20px !important;
    }
    
    .blog-title {
        font-size: 1.25rem !important;
    }
    
    .blog-excerpt {
        font-size: 0.9rem;
    }
    
    /* Case Study Cards */
    .case-study-image {
        height: 200px !important;
        min-height: 200px !important;
        max-width: 100% !important;
        width: 100% !important;
        object-fit: cover !important;
    }
    
    .case-study-content {
        padding: 20px !important;
    }
    
    .case-study-title {
        font-size: 1.5rem !important;
    }
    
    .case-study-description {
        font-size: 0.95rem;
    }
    
    .case-study-stats {
        flex-direction: column;
        gap: 15px;
        padding: 15px 0;
    }
    
    .case-study-stats .stat-number {
        font-size: 2rem !important;
    }
    
    /* FAQ */
    .faq-btn {
        padding: 15px !important;
        font-size: 0.95rem;
    }
    
    .faq-card .card-body {
        padding: 15px !important;
        font-size: 0.9rem;
    }
    
    /* Forms */
    .form-control {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px 15px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .btn {
        min-height: 44px; /* Touch-friendly size */
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 14px 24px;
        font-size: 1.1rem;
    }
    
    /* Newsletter Form */
    .newsletter-form .form-control {
        border-radius: 25px !important;
        margin-bottom: 10px;
    }
    
    .newsletter-form .btn {
        border-radius: 25px !important;
        width: 100%;
    }
    
    /* WhatsApp Button */
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 15px;
        right: 15px;
    }
    
    /* Blog Categories */
    .blog-categories {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .blog-categories .btn {
        margin: 3px;
        font-size: 0.8rem;
        padding: 6px 12px;
        min-height: 36px;
    }
    
    /* Blog Share Buttons */
    .blog-share {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .blog-share .btn {
        min-width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    /* Section Titles */
    .section-title h4 {
        font-size: 0.9rem !important;
    }
    
    .section-title h1 {
        font-size: 1.75rem !important;
    }
    
    /* Containers */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Spacing */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    /* Footer */
    .footer .col-lg-3,
    .footer .col-md-6 {
        margin-bottom: 30px;
    }
    
    /* Event Cards */
    .event-card img {
        height: 200px !important;
    }
    
    /* Contact Form */
    .contact-form {
        padding: 20px;
    }
    
    /* Google Maps */
    iframe {
        height: 250px !important;
    }
}

/* ============================================
   Tablet Optimization (577px - 768px)
   ============================================ */
@media (min-width: 577px) and (max-width: 768px) {
    /* Statistics Section */
    .statistics-section {
        padding: 60px 0;
    }
    
    .stat-number {
        font-size: 3rem;
    }
    
    .stat-label {
        font-size: 1rem;
    }
    
    /* Page Headers */
    .page-header {
        min-height: 300px;
    }
    
    .page-header h1 {
        font-size: 2.5rem;
    }
    
    /* Blog Cards */
    .blog-image {
        height: 220px;
    }
    
    /* Case Study Cards */
    .case-study-image {
        height: 250px;
    }
    
    /* Forms */
    .form-control {
        font-size: 16px;
    }
    
    .btn {
        min-height: 44px;
    }
    
    /* WhatsApp Button */
    .whatsapp-float {
        width: 55px;
        height: 55px;
        font-size: 26px;
        bottom: 20px;
        right: 20px;
    }
}

/* ============================================
   Mobile Optimization - All Small Screens (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    /* Statistics Section */
    .statistics-section {
        padding: 50px 0;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .case-study-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    /* WhatsApp Button */
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 20px;
        right: 20px;
    }
    
    /* Blog Categories */
    .blog-categories {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .blog-categories .btn {
        margin: 5px;
        font-size: 0.85rem;
        padding: 5px 10px;
    }
    
    /* Blog Share */
    .blog-share {
        margin-top: 10px;
    }
    
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    /* Service Cards - Disable hover on touch devices */
    .service-card:hover {
        transform: none;
    }
    
    /* Testimonial Cards - Disable hover on touch devices */
    .testimonial-card:hover {
        transform: none;
    }
    
    /* Blog Cards - Disable hover on touch devices */
    .blog-card:hover {
        transform: none;
    }
    
    /* Case Study Cards - Disable hover on touch devices */
    .case-study-card:hover {
        transform: none;
    }
    
    /* Images - General rule (but not for blog/case-study images) */
    img:not(.blog-image):not(.case-study-image) {
        max-width: 100%;
        height: auto;
    }
    
    /* Ensure blog and case study images don't overflow - CRITICAL FIX */
    .blog-image {
        max-width: 100% !important;
        width: 100% !important;
        height: 200px !important;
        min-height: 200px !important;
        object-fit: cover !important;
        display: block !important;
    }
    
    .case-study-image {
        max-width: 100% !important;
        width: 100% !important;
        height: 200px !important;
        min-height: 200px !important;
        object-fit: cover !important;
        display: block !important;
    }
    
    .blog-card,
    .case-study-card {
        overflow: hidden !important;
        max-width: 100% !important;
    }
    
    /* Tables */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Carousel */
    .owl-carousel {
        padding: 0 15px;
    }
    
    /* Text Alignment */
    .text-center-mobile {
        text-align: center !important;
    }
    
    /* Hide on mobile if needed */
    .hide-mobile {
        display: none !important;
    }
    
    /* Show on mobile if needed */
    .show-mobile {
        display: block !important;
    }
}

/* ============================================
   Touch Device Optimizations
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .service-card:hover,
    .testimonial-card:hover,
    .blog-card:hover,
    .case-study-card:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    /* Increase touch target sizes */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better tap feedback */
    .btn:active {
        transform: scale(0.95);
    }
}

/* ============================================
   Accessibility Styles
   ============================================ */
a:focus,
button:focus {
    outline: 3px solid #DA9F5B;
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #33211D;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   Smooth Scrolling
   ============================================ */
html {
    scroll-behavior: smooth;
}

/* ============================================
   Loading Animation for Images
   ============================================ */
img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Ensure blog and case study images are always visible */
.blog-image[loading="lazy"],
.case-study-image[loading="lazy"] {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* ============================================
   Animation Classes
   ============================================ */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Breadcrumb Styles
   ============================================ */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #6c757d;
    padding: 0 0.5rem;
}

.breadcrumb-item a {
    color: #DA9F5B;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #c88d4a;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* ============================================
   Form Improvements
   ============================================ */
.form-message {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 5px;
}

.form-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.form-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.btn-loading {
    display: inline-block;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   Blog Share Buttons
   ============================================ */
.blog-share {
    display: flex;
    gap: 5px;
}

.blog-share .btn {
    padding: 5px 10px;
    font-size: 0.85rem;
    min-width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.blog-share .btn:hover {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .blog-share {
        margin-top: 10px;
    }
    
    .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
    }
}

/* ============================================
   Performance Optimizations
   ============================================ */
img[loading="lazy"] {
    will-change: opacity;
}

/* Preload critical resources */
@supports (font-display: swap) {
    @font-face {
        font-family: 'Montserrat';
        font-display: swap;
    }
}

