/* ============================================
   UI/UX FIXES FOR RPAM INDUSTRIES
   Critical fixes for visibility, responsiveness, and design issues
   ============================================ */

/* ============================================
   1. HERO SECTION FIXES
   ============================================ */

/* Fix hero section text visibility on background images */
.hero {
    position: relative;
}

.hero .hero-title,
.hero .hero-tagline {
    text-shadow: 2px 2px 12px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.6);
    color: #FFFFFF !important;
}

/* Ensure hero buttons are visible and accessible */
.hero .btn {
    min-height: 48px;
    /* Touch-friendly */
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Fix hero background attachment on mobile */
@media (max-width: 768px) {
    .hero {
        background-attachment: scroll !important;
        min-height: 50vh !important;
    }

    .hero .hero-title {
        font-size: 2rem !important;
    }

    .hero .hero-tagline {
        font-size: 1.1rem !important;
    }
}

/* ============================================
   2. WHATSAPP BUTTON FIXES
   ============================================ */

/* Enhanced WhatsApp button with better visibility and animation */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    animation: whatsappPulse 2s infinite;
}

.whatsapp-float::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.3);
    animation: whatsappRipple 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.5),
        0 6px 16px rgba(0, 0, 0, 0.4);
}

.whatsapp-float svg {
    width: 38px;
    height: 38px;
    fill: white;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes whatsappPulse {

    0%,
    100% {
        box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4),
            0 4px 12px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 12px 32px rgba(37, 211, 102, 0.6),
            0 6px 16px rgba(0, 0, 0, 0.4);
    }
}

@keyframes whatsappRipple {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Mobile WhatsApp button */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    .whatsapp-float svg {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
        width: 52px;
        height: 52px;
    }
}

/* ============================================
   3. FONT VISIBILITY & READABILITY FIXES
   ============================================ */

/* Improve text contrast on light backgrounds */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure minimum font sizes for readability */
p {
    font-size: 16px;
    line-height: 1.7;
    color: #2C1810 !important;
    opacity: 1 !important;
}

@media (max-width: 768px) {
    p {
        font-size: 15px;
        line-height: 1.6;
    }
}

/* Fix heading visibility with reduced font weight */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600 !important;
    /* Reduced from 700 */
    color: #2C1810 !important;
    opacity: 1 !important;
}

h1 {
    font-weight: 600 !important;
}

h2 {
    font-weight: 600 !important;
}

h3 {
    font-weight: 600 !important;
}

h4 {
    font-weight: 600 !important;
}

/* Card titles visibility */
.card-title {
    font-weight: 600 !important;
    color: #2C1810 !important;
}

/* Section titles visibility */
.section-title {
    font-weight: 600 !important;
    color: #2C1810 !important;
}

/* Hero titles - slightly bolder for impact */
.hero-title {
    font-weight: 700 !important;
    color: #FFFFFF !important;
}

.hero-tagline {
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Ensure all text elements are visible */
span,
div,
li,
td,
th,
label {
    color: #2C1810;
}

/* Footer text visibility */
.footer {
    color: rgba(255, 255, 255, 0.95) !important;
}

.footer p,
.footer h3,
.footer a,
.footer span,
.footer div {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* ============================================
   4. BUTTON DESIGN FIXES
   ============================================ */

/* Ensure all buttons meet accessibility standards */
.btn {
    min-height: 48px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Primary button */
.btn-primary,
.btn:not(.btn-outline) {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #A0522D 0%, #E67E22 100%);
}

/* Outline button */
.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
    color: inherit;
}

.btn-outline:hover {
    background: rgba(139, 69, 19, 0.1);
}

/* Mobile button adjustments */
@media (max-width: 768px) {
    .btn {
        width: 100%;
        max-width: 300px;
        padding: 14px 24px;
    }
}

/* ============================================
   17. ADDITIONAL TEXT VISIBILITY FIXES
   ============================================ */

/* Navbar text visibility */
.navbar-menu a {
    color: var(--color-light) !important;
    font-weight: 500;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--color-accent) !important;
}

.dropdown-toggle {
    color: var(--color-light) !important;
}

.dropdown-menu a {
    color: var(--color-light) !important;
}

/* Card text visibility */
.card {
    background: white !important;
}

.card-body {
    color: #2C1810 !important;
}

.card-text {
    color: #2C1810 !important;
    opacity: 0.9;
}

/* Glass card visibility */
.glass-card {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #2C1810 !important;
}

.glass-card p,
.glass-card h3,
.glass-card h4 {
    color: #2C1810 !important;
}

/* Scroll reveal text */
.scroll-reveal {
    color: inherit;
}

/* Feature cards */
.feature-card,
.service-card {
    background: white;
    color: #2C1810;
}

/* Ensure list items are visible */
ul li,
ol li {
    color: #2C1810;
}

/* Table text visibility */
table {
    color: #2C1810;
}

/* Form labels */
label {
    color: #2C1810 !important;
    font-weight: 500;
}

/* Placeholder text */
::placeholder {
    color: rgba(44, 24, 16, 0.5) !important;
    opacity: 1;
}

/* Strong and bold text */
strong,
b {
    font-weight: 600;
    color: #2C1810;
}

/* Emphasis text */
em,
i {
    color: #2C1810;
}

/* Small text */
small {
    color: rgba(44, 24, 16, 0.8);
}

/* ============================================
   5. MOBILE RESPONSIVE FIXES
   ============================================ */

/* Grid system responsive fixes */
@media (max-width: 992px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Container padding fixes */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .section {
        padding: 3rem 0;
    }
}

/* ============================================
   6. NAVIGATION MENU MOBILE FIXES
   ============================================ */

/* Mobile menu improvements */
@media (max-width: 992px) {
    .navbar-menu {
        position: fixed;
        top: 76px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 76px);
        max-height: calc(100vh - 76px);
        background: rgba(44, 24, 16, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem;
        transition: left 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 999;
        -webkit-overflow-scrolling: touch;
    }

    .navbar-menu.active {
        left: 0;
    }

    .navbar-menu a {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .menu-toggle {
        display: flex !important;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(139, 69, 19, 0.2);
        margin-top: 0.5rem;
        padding-left: 1rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease, padding 0.4s ease;
    }

    /* Support both .active and .open classes for compatibility */
    .dropdown.active .dropdown-menu,
    .dropdown.open .dropdown-menu {
        max-height: 800px !important;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        overflow-y: auto !important;
    }

    /* Ensure dropdown items are visible */
    .dropdown-menu a {
        display: block !important;
        width: 100%;
        padding: 0.75rem 1rem !important;
        font-size: 1rem !important;
        color: rgba(255, 255, 255, 0.9) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .dropdown-menu a:hover {
        background: rgba(139, 69, 19, 0.3);
        color: #CD853F !important;
    }

    /* Dropdown toggle indicator */
    .dropdown-toggle {
        position: relative;
        padding-right: 2rem !important;
    }

    .dropdown-toggle::after {
        content: '▼';
        position: absolute;
        right: 1rem;
        transition: transform 0.3s ease;
        font-size: 0.8rem;
    }

    .dropdown.active .dropdown-toggle::after,
    .dropdown.open .dropdown-toggle::after {
        transform: rotate(180deg);
    }
}

/* ============================================
   7. FOOTER RESPONSIVE FIXES
   ============================================ */

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-section {
        padding: 1.5rem 0;
        border-bottom: 1px solid rgba(139, 69, 19, 0.2);
    }

    .footer-section:last-child {
        border-bottom: none;
    }

    .footer-logo {
        margin: 0 auto 1rem;
    }
}

/* ============================================
   16. FOOTER COPYRIGHT VISIBILITY FIX
   ============================================ */

/* Enhanced footer bottom visibility */
.footer-bottom {
    text-align: center;
    padding: 2rem 0 1.5rem;
    margin-top: 2rem;
    border-top: 2px solid rgba(245, 222, 179, 0.3);
    background: rgba(44, 24, 16, 0.3);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.95) !important;
    opacity: 1 !important;
    font-size: 15px;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.5px;
}

/* Mobile footer bottom */
@media (max-width: 768px) {
    .footer-bottom {
        padding: 1.5rem 0 1rem;
    }

    .footer-bottom p {
        font-size: 14px;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .footer-bottom p {
        font-size: 13px;
    }
}

/* ============================================
   8. GALLERY LIGHTBOX FIXES
   ============================================ */

/* Ensure lightbox is accessible and visible */
.lightbox {
    z-index: 10000 !important;
}

.lightbox-close,
.lightbox-nav {
    background: rgba(255, 255, 255, 0.95);
    color: #2C1810;
    font-weight: bold;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: #8B4513;
    color: white;
}

/* Mobile lightbox controls */
@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}

/* ============================================
   9. COLOR CONTRAST FIXES
   ============================================ */

/* Ensure sufficient contrast for accessibility */
.card {
    background: white;
    color: #2C1810;
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #2C1810;
}

/* Link colors for better visibility */
a {
    color: #8B4513;
}

a:hover {
    color: #D2691E;
}

/* Footer link visibility */
.footer a {
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #CD853F;
}

/* ============================================
   11. SCROLL BEHAVIOR FIXES
   ============================================ */

/* Smooth scroll with offset for fixed navbar */
html {
    scroll-padding-top: 100px;
}

/* ============================================
   12. IMAGE LOADING & OPTIMIZATION
   ============================================ */

/* Prevent layout shift during image loading */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Gallery images */
.gallery-item img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* ============================================
   13. ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid #8B4513;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: #8B4513;
    color: white;
    padding: 1rem 2rem;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
}

/* ============================================
   14. PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   15. PRINT STYLES
   ============================================ */

@media print {

    .navbar,
    .whatsapp-float,
    .hero-slider-nav,
    .hero-arrow {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}