/* Custom styles for advanced UI and animations */

/* Advanced animations */
.animated-gradient {
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Rotating gradient animation for background */
.rotating-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(63,82,227,0.15) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    animation: rotateGradient 20s linear infinite;
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Glassmorphism effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Hover effects */
.hover-lift {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hover-lift:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Advanced button styles */
.btn-animated {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-animated:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: -1;
}

.btn-animated:hover:after {
    transform: translateX(100%);
}

/* Floating elements */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

/* Pulse effect */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(63, 82, 227, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(63, 82, 227, 0); }
    100% { box-shadow: 0 0 0 0 rgba(63, 82, 227, 0); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Advanced card styles */
.card-modern {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
}

.card-modern .card-img-top {
    transition: all 0.5s ease;
}

.card-modern:hover .card-img-top {
    transform: scale(1.1);
}

.card-modern .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(63, 82, 227, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card-modern:hover .card-overlay {
    opacity: 1;
}

/* Advanced typography */
.text-gradient {
    background: linear-gradient(135deg, #3f52e3 0%, #6c7ae9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Advanced form styles */
.form-control-modern {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 20px;
    transition: all 0.3s ease;
}

.form-control-modern:focus {
    border-color: #3f52e3;
    box-shadow: 0 0 0 0.2rem rgba(63, 82, 227, 0.25);
}

/* Advanced navigation */
.navbar-transparent {
    background: transparent !important;
    transition: all 0.4s ease;
}

.navbar-transparent.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Advanced progress bars */
.progress-modern {
    height: 12px;
    border-radius: 10px;
    overflow: hidden;
    background-color: #e9ecef;
}

.progress-bar-modern {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
    position: relative;
}

.progress-bar-modern:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Advanced modal styles */
.modal-modern .modal-content {
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.modal-header-modern {
    background: linear-gradient(135deg, #3f52e3 0%, #6c7ae9 100%);
    color: white;
    border: none;
}

/* Advanced list styles */
.list-modern {
    list-style: none;
    padding: 0;
}

.list-modern li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 15px;
}

.list-modern li:before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(135deg, #3f52e3 0%, #21bf73 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Advanced tooltip styles */
.tooltip-modern {
    position: relative;
    display: inline-block;
}

.tooltip-modern .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
}

.tooltip-modern:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Advanced badge styles */
.badge-modern {
    border-radius: 50px;
    padding: 8px 16px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Advanced table styles */
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.table-modern th {
    background: linear-gradient(135deg, #3f52e3 0%, #6c7ae9 100%);
    color: white;
    font-weight: 600;
}

.table-modern th, .table-modern td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.table-modern tr:last-child td {
    border-bottom: none;
}

/* Advanced timeline */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #3f52e3 0%, #6c7ae9 100%);
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

.timeline-item {
    margin-bottom: 40px;
    position: relative;
}

.timeline-item:nth-child(odd) {
    padding-right: calc(50% + 30px);
    text-align: right;
}

.timeline-item:nth-child(even) {
    padding-left: calc(50% + 30px);
}

.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid #3f52e3;
    top: 10px;
    left: 50%;
    margin-left: -10px;
    z-index: 1;
}

/* Advanced carousel */
.carousel-modern .carousel-indicators li {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: #aaa;
    transition: all 0.3s ease;
}

.carousel-modern .carousel-indicators li.active {
    background: #3f52e3;
    transform: scale(1.2);
}

/* Advanced footer */
.footer-modern {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.footer-modern:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 70%);
    z-index: 0;
}

.footer-modern .footer-content {
    position: relative;
    z-index: 1;
}

/* Advanced button group */
.btn-group-modern .btn {
    border-radius: 0;
    border: 1px solid #dee2e6;
    background: white;
    transition: all 0.3s ease;
}

.btn-group-modern .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.btn-group-modern .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.btn-group-modern .btn.active {
    background: #3f52e3;
    border-color: #3f52e3;
    color: white;
}

/* Advanced alert */
.alert-modern {
    border: none;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.alert-modern:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(135deg, #3f52e3 0%, #6c7ae9 100%);
}

/* Advanced pagination */
.pagination-modern .page-item .page-link {
    border: none;
    border-radius: 8px;
    margin: 0 5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pagination-modern .page-item.active .page-link {
    background: linear-gradient(135deg, #3f52e3 0%, #6c7ae9 100%);
    border-color: transparent;
}

/* Advanced dropdown */
.dropdown-menu-modern {
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
}

.dropdown-menu-modern .dropdown-item {
    padding: 10px 20px;
    transition: all 0.2s ease;
}

.dropdown-menu-modern .dropdown-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

/* Advanced badge with animation */
.badge-animated {
    position: relative;
    overflow: hidden;
}

.badge-animated:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.badge-animated:hover:before {
    left: 100%;
}

/* Advanced form switch */
.form-switch-modern .form-check-input {
    height: 24px;
    width: 48px;
    border-radius: 12px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
}

.form-switch-modern .form-check-input:checked {
    background-color: #3f52e3;
    border-color: #3f52e3;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

/* Advanced range slider */
.form-range-modern {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
}

.form-range-modern::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3f52e3;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-range-modern::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Advanced progress circle */
.progress-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(#3f52e3 0%, #3f52e3 75%, #e9ecef 75%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle-inner {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #3f52e3;
}

/* Advanced toast */
.toast-modern {
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Advanced nav tabs */
.nav-tabs-modern {
    border: none;
    border-bottom: 2px solid #e9ecef;
}

.nav-tabs-modern .nav-link {
    border: none;
    border-radius: 0;
    margin-bottom: -2px;
    position: relative;
    transition: all 0.3s ease;
}

.nav-tabs-modern .nav-link.active {
    color: #3f52e3;
    font-weight: 600;
}

.nav-tabs-modern .nav-link.active:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #3f52e3;
}

/* Advanced card deck */
.card-deck-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

/* Advanced breadcrumb */
.breadcrumb-modern {
    background: transparent;
    padding: 0;
}

.breadcrumb-modern .breadcrumb-item + .breadcrumb-item::before {
    content: '>';
    color: #adb5bd;
}

.breadcrumb-modern .breadcrumb-item a {
    color: #6c757d;
    transition: all 0.3s ease;
}

.breadcrumb-modern .breadcrumb-item a:hover {
    color: #3f52e3;
    padding-left: 5px;
}

/* Advanced spinner */
.spinner-modern {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(63, 82, 227, 0.2);
    border-top: 4px solid #3f52e3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Advanced tooltip arrow */
.tooltip-arrow-modern {
    position: relative;
}

.tooltip-arrow-modern:after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

/* Advanced modal animation */
.modal-animated .modal-dialog {
    transform: translate(0, -50px);
    transition: transform 0.3s ease-out;
}

.modal-animated.show .modal-dialog {
    transform: translate(0, 0);
}

/* Advanced image hover effect */
.image-hover-zoom img {
    transition: transform 0.5s ease;
}

.image-hover-zoom:hover img {
    transform: scale(1.1);
}

/* Advanced button loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

/* Ripple effect for buttons */
.ripple {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.7);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Enhanced scroll progress indicator */
#scrollProgress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #3f52e3, #21bf73);
    z-index: 1001;
    transition: width 0.1s ease;
}

/* Enhanced scrolling effects */
.scroll-animated {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.scroll-animated.animate__animated {
    opacity: 1;
    transform: translateY(0);
}

/* Floating action button styles */
#scrollToTop, #themeToggle {
    transition: all 0.3s ease;
}

#scrollToTop:hover, #themeToggle:hover {
    transform: scale(1.1) rotate(10deg);
}

/* Enhanced service card styles */
.service-card {
    background: white;
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
    z-index: -1;
}

.service-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 20px 40px rgba(63, 82, 227, 0.2);
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* Enhanced pricing card styles */
.pricing-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.pricing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
    z-index: -1;
}

.pricing-card.popular {
    border: 2px solid var(--secondary);
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(33, 191, 115, 0.2);
}

.pricing-card.popular::before {
    background: linear-gradient(90deg, var(--secondary), var(--primary));
}

.pricing-card.popular:after {
    content: '推荐';
    position: absolute;
    top: 20px;
    right: -30px;
    background: var(--secondary);
    color: white;
    padding: 5px 30px;
    transform: rotate(45deg);
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 10;
}

.pricing-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 20px 40px rgba(63, 82, 227, 0.2);
}

.pricing-card:hover::before {
    transform: scaleX(1);
}

/* FAQ styles */
.faq-item {
    margin-bottom: 20px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.faq-item:hover {
    box-shadow: 0 10px 25px rgba(63, 82, 227, 0.1);
    transform: translateY(-3px);
}

.faq-question {
    padding: 20px;
    background: var(--light);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: #e9ecef;
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: white;
}

.faq-item.active .faq-answer {
    padding: 20px;
    max-height: 1000px;
}

.faq-item.active .faq-question {
    background: #fff;
    color: var(--primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .timeline:before {
        left: 30px;
    }
    
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        padding: 0 0 0 60px;
        text-align: left;
    }
    
    .timeline-dot {
        left: 30px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}