/* ==========================================================================
   3Cipercash - Visual Fixes & Optimizations
   ========================================================================== */

/* ==================== Global Fixes ==================== */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent text overflow */
body {
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ==================== Logo Visibility ==================== */
.logo-img {
    /* Force visibility */
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Ensure logo has white background for visibility */
.navbar .logo-img {
    background: white !important;
}

.footer .logo-img {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* ==================== Hero Text Fixes ==================== */
.hero-title,
.hero-subtitle {
    /* Prevent text cutoff */
    padding: 0 !important;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    box-sizing: border-box;
}

.hero-title {
    /* Better contrast */
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.4),
                 0 4px 30px rgba(0, 0, 0, 0.3) !important;
}

.hero-subtitle {
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4),
                 0 4px 25px rgba(0, 0, 0, 0.3) !important;
}

/* ==================== Container Spacing ==================== */
.hero .container {
    padding-left: clamp(20px, 5vw, 40px) !important;
    padding-right: clamp(20px, 5vw, 40px) !important;
}

/* Prevent section overlap with fixed navbar */
section {
    scroll-margin-top: 120px;
}

.section {
    scroll-margin-top: 120px;
}

/* ==================== Mobile Specific Fixes ==================== */
@media screen and (max-width: 768px) {
    /* Hero text spacing */
    .hero-content {
        padding: 0 clamp(16px, 4vw, 24px) !important;
        max-width: 100%;
    }
    
    .hero-title {
        font-size: clamp(1.625rem, 6vw, 1.875rem) !important;
        line-height: 1.3 !important;
        margin-bottom: clamp(0.875rem, 3vw, 1rem) !important;
        word-break: break-word;
        hyphens: auto;
    }
    
    .hero-subtitle {
        font-size: clamp(0.9375rem, 4vw, 1.0625rem) !important;
        line-height: 1.65 !important;
        margin-bottom: clamp(1.25rem, 4vw, 1.5rem) !important;
        word-break: break-word;
    }
    
    /* CTA buttons mobile */
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
        padding: 0 20px !important;
    }
    
    .hero-cta .btn {
        width: 100%;
        min-width: auto;
    }
    
    /* Logo mobile fix */
    .navbar .logo-img {
        height: 48px !important;
        padding: 6px 12px !important;
    }
}

@media screen and (max-width: 480px) {
    .hero .container {
        padding-left: clamp(16px, 5vw, 20px) !important;
        padding-right: clamp(16px, 5vw, 20px) !important;
    }
    
    .hero-content {
        padding: 0 clamp(12px, 3vw, 16px) !important;
    }
    
    .hero-title {
        font-size: clamp(1.5rem, 7vw, 1.625rem) !important;
        line-height: 1.35 !important;
        letter-spacing: -0.02em;
    }
    
    .hero-subtitle {
        font-size: clamp(0.875rem, 4vw, 0.9375rem) !important;
        line-height: 1.6 !important;
    }
    
    .navbar .logo-img {
        height: 42px !important;
        padding: 5px 10px !important;
    }
}

/* ==================== Header Top Mobile ==================== */
@media screen and (max-width: 768px) {
    .header-top {
        padding: 8px 0;
    }
    
    .header-contact {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .header-contact-item {
        font-size: 0.8125rem;
    }
}

/* ==================== Stats Mobile ==================== */
@media screen and (max-width: 768px) {
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
        padding: 0 20px;
    }
    
    .stat-item {
        width: 100%;
        max-width: 100%;
    }
}

/* ==================== Prevent Layout Shift ==================== */
.navbar {
    min-height: 76px;
}

@media screen and (max-width: 768px) {
    .navbar {
        min-height: 68px;
    }
}

@media screen and (max-width: 480px) {
    .navbar {
        min-height: 62px;
    }
}

/* ==================== Smooth Scrolling ==================== */
html {
    scroll-padding-top: 120px;
}

@media screen and (max-width: 768px) {
    html {
        scroll-padding-top: 90px;
    }
    
    section,
    .section {
        scroll-margin-top: 90px;
    }
}

/* ==================== Better Button Visibility ==================== */
.btn {
    white-space: nowrap;
}

.btn-large {
    min-height: 52px;
}

@media screen and (max-width: 768px) {
    .btn-large {
        min-height: 48px;
        font-size: 1rem;
    }
}

/* ==================== Section Padding Mobile ==================== */
@media screen and (max-width: 768px) {
    .section {
        padding: 3rem 0;
    }
    
    .section-header {
        padding: 0 20px;
        margin-bottom: 2rem;
    }
}

/* ==================== Fix for iOS Safari ==================== */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
}

/* ==================== Accessibility Improvements ==================== */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ==================== Performance Optimizations ==================== */
/* Desktop only - remove will-change on mobile for better performance */
@media screen and (min-width: 769px) {
    .hero-background,
    .hero-shapes,
    .shape {
        will-change: transform;
        transform: translateZ(0);
        backface-visibility: hidden;
    }
}

/* Mobile: disable heavy 3D effects */
@media screen and (max-width: 768px) {
    .card-3d {
        transform: none !important;
        transition: box-shadow 0.25s ease, transform 0.25s ease;
    }
    
    .card-3d:hover,
    .card-3d:active {
        transform: translateY(-4px) !important;
        box-shadow: 0 8px 20px rgba(0, 82, 204, 0.15);
    }
}

/* ==================== Print Styles ==================== */
@media print {
    .header-top,
    .navbar,
    .back-to-top,
    .hero-scroll-indicator {
        display: none !important;
    }
}
