/* Referral Program Styles */

/* Enhanced System Architecture Styles */
.system-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px !important;
    overflow: hidden;
    position: relative;
}

.system-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

.system-card:hover .system-icon-container > div {
    transform: scale(1.1) rotate(5deg);
}

.system-card:hover .feature-item {
    transform: translateX(5px);
    background-color: rgba(255, 255, 255, 0.8);
}

.system-card:hover .btn {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Flow Diagram Enhancements */
.flow-node {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px !important;
    overflow: hidden;
}

.flow-node:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12) !important;
}

.flow-node:hover .progress-bar {
    animation: progressFill 0.8s ease-in-out;
}

@keyframes progressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
    .system-card {
        margin-bottom: 1.5rem;
    }
    
    .system-card .card-body {
        padding: 1.5rem !important;
    }
    
    .system-icon-container > div {
        width: 60px !important;
        height: 60px !important;
    }
    
    .system-icon-container i {
        font-size: 1.8rem !important;
    }
    
    .flow-node .card-body {
        padding: 1.5rem !important;
    }
    
    .flow-node > div {
        width: 50px !important;
        height: 50px !important;
    }
    
    .flow-node i {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 576px) {
    .system-card .card-body {
        padding: 1rem !important;
    }
    
    .system-card h5 {
        font-size: 1.1rem !important;
    }
    
    .system-card p {
        font-size: 0.85rem !important;
    }
    
    .feature-item {
        padding: 0.25rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .feature-item span {
        font-size: 0.8rem !important;
    }
    
    .flow-node .card-body {
        padding: 1rem !important;
    }
    
    .flow-node h5 {
        font-size: 1rem !important;
    }
    
    .flow-node p {
        font-size: 0.8rem !important;
    }
}

/* Animation Enhancements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.system-card-wrapper[data-aos="fade-up"] {
    animation: fadeInUp 0.6s ease-out;
}

.flow-node-wrapper[data-aos="fade-up"] {
    animation: fadeInUp 0.6s ease-out;
}

/* Background Enhancements */
.bg-light {
    background-color: #f8f9fa !important;
}

/* Button Hover Effects */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Stats Badge Animation */
.system-card:hover .position-absolute.top-0.end-0 {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Connection Line Animation */
.connection-line-mobile {
    animation: drawLine 1s ease-in-out;
}

@keyframes drawLine {
    0% { height: 0; opacity: 0; }
    100% { height: 40px; opacity: 1; }
}

/* Hero Section Enhancements */
.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Referral Benefits */
.referral-benefit {
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.referral-benefit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(13, 110, 253, 0.1), transparent);
    transition: left 0.5s ease;
}

.referral-benefit:hover::before {
    left: 100%;
}

.referral-benefit:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: rgba(13, 110, 253, 0.2);
}

.benefit-icon {
    transition: all 0.3s ease;
}

.referral-benefit:hover .benefit-icon {
    transform: scale(1.1);
}

/* Referral Calculator */
.referral-calculator {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    box-shadow: 0 20px 40px rgba(13, 110, 253, 0.3);
}

.calculation-results {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.calculation-results .h5 {
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Referral Flow */
.referral-flow {
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.flow-step {
    transition: all 0.3s ease;
}

.flow-step:hover {
    transform: translateY(-5px);
}

.step-icon {
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.flow-step:hover .step-icon {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.allocation-breakdown {
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.allocation-breakdown .h4 {
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Benefits Cards */
.benefit-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.benefit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(25, 135, 84, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.benefit-card:hover::before {
    opacity: 1;
}

.benefit-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(13, 110, 253, 0.2);
}

.benefit-icon-wrapper {
    transition: all 0.3s ease;
}

.benefit-card:hover .benefit-icon-wrapper {
    transform: scale(1.1);
}

/* Form Controls */
.referral-calculator .form-control,
.referral-calculator .form-select {
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.referral-calculator .form-control:focus,
.referral-calculator .form-select:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    color: white;
}

.referral-calculator .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.referral-calculator .form-select option {
    background: #0a58ca;
    color: white;
}

/* Buttons */
.btn-light {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: #0d6efd;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-light:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section .display-4 {
        font-size: 2.5rem;
    }
    
    .referral-calculator {
        margin-top: 2rem;
    }
    
    .flow-step {
        margin-bottom: 2rem;
    }
    
    .benefit-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .referral-benefit {
        margin-bottom: 1rem;
    }
    
    .calculation-results .h5 {
        font-size: 1.1rem;
    }
    
    .allocation-breakdown .h4 {
        font-size: 1.5rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success States */
.success-animation {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Enhanced Referral Tracking Calculator */
.referral-tracking-calculator {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    box-shadow: 0 20px 40px rgba(13, 110, 253, 0.3);
}

.installment-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.installment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.wallet-simulation {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Calculator Result Highlighting */
.result-highlight {
    animation: resultHighlight 0.6s ease-out;
}

@keyframes resultHighlight {
    0% { 
        background-color: rgba(25, 135, 84, 0.2);
        transform: scale(1);
    }
    50% { 
        background-color: rgba(25, 135, 84, 0.4);
        transform: scale(1.05);
    }
    100% { 
        background-color: transparent;
        transform: scale(1);
    }
}

/* Calculator Card Animations */
.calculator-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.calculator-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(13, 110, 253, 0.3);
}

/* Form Input Enhancements */
.referral-tracking-calculator .form-control,
.referral-tracking-calculator .form-select {
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.referral-tracking-calculator .form-control:focus,
.referral-tracking-calculator .form-select:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    color: white;
}

.referral-tracking-calculator .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.referral-tracking-calculator .form-select option {
    background: #0a58ca;
    color: white;
}

.referral-tracking-calculator .form-label {
    color: white;
    font-weight: 600;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .referral-benefit {
        border: 2px solid #000;
    }
    
    .benefit-card {
        border: 2px solid #000;
    }
    
    .form-control {
        border: 2px solid #000;
    }
    
    .referral-tracking-calculator .form-control {
        border: 2px solid #fff;
    }
    
    .installment-card {
        border: 2px solid #fff;
    }
}
