/* ==========================================================================
   MANDALA CYBERNETICS - MASTER UTILITY FRAMEWORK (V2.0)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BACKGROUNDS & SURFACES
   -------------------------------------------------------------------------- */
.bg-gradient-cyber {
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%) !important;
    color: #ffffff !important;
}

.bg-gradient-neon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: #ffffff !important;
}

.bg-gradient-glass {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   2. LAYOUT & GRID SYSTEM (Future-Proofed)
   -------------------------------------------------------------------------- */
.m-section-padding {
    padding: 80px 20px !important;
    max-width: 1200px;
    margin: 0 auto;
}

.m-grid {
    display: grid;
    gap: 30px;
    width: 100%;
}

/* Mobile defaults to 1 column. Desktop scales based on modifier class. */
@media (min-width: 768px) {
    .m-grid-2 { grid-template-columns: repeat(2, 1fr); }
    .m-grid-3 { grid-template-columns: repeat(3, 1fr); }
    .m-grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --------------------------------------------------------------------------
   3. MODERN CARDS
   -------------------------------------------------------------------------- */
.m-card {
    border-radius: 16px !important;
    padding: 32px !important;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease !important;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 1;
}

.m-card:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

.m-card-light {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #1a202c !important;
}

.m-card-dark {
    background-color: #1a202c !important;
    border: 1px solid #2d3748 !important;
    color: #f7fafc !important;
}

/* Force text visibility inside dark cards */
.m-card-dark h1, .m-card-dark h2, .m-card-dark h3, .m-card-dark p {
    color: #f7fafc !important;
}

/* --------------------------------------------------------------------------
   4. PREMIUM BUTTONS & INTERACTIONS
   -------------------------------------------------------------------------- */
.m-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 32px !important;
    border-radius: 50px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border: none !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
    width: fit-content !important;
    line-height: 1.5 !important;
}

.m-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
}

.m-btn-primary:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6) !important;
    color: #ffffff !important;
}

/* Button Micro-interaction: Shine Sweep */
.m-btn-shine {
    position: relative;
    overflow: hidden;
}

.m-btn-shine::after {
    content: '';
    position: absolute;
    top: 0; 
    left: -150%;
    width: 50%; 
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: all 0.6s ease;
    z-index: 2;
}

.m-btn-shine:hover::after {
    left: 150%;
    transition: all 0.6s ease;
}

/* Button Micro-interaction: Neon Pulse */
.m-btn-pulse {
    animation: pulse-shadow 2s infinite;
}

@keyframes pulse-shadow {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

/* --------------------------------------------------------------------------
   5. MULTI-DIRECTIONAL SCROLL ENGINE
   -------------------------------------------------------------------------- */
/* Base State (Hidden, moved down by default) */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: opacity, transform;
}

/* Direction Modifiers (Optional - changes starting position) */
.animate-on-scroll.fade-left { transform: translateX(-60px) translateY(0); }
.animate-on-scroll.fade-right { transform: translateX(60px) translateY(0); }
.animate-on-scroll.zoom-in { transform: scale(0.85) translateY(0); }

/* Staggered Delays for Grid items */
.delay-100 { transition-delay: 0.1s !important; }
.delay-200 { transition-delay: 0.2s !important; }
.delay-300 { transition-delay: 0.3s !important; }

/* Triggered State (Visible, reset to origin) */
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
}