/* Custom Styles for Gold Trading Investment Platform */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* Custom Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Smooth Scroll Offset for Fixed Header */
section {
    scroll-margin-top: 80px;
}

/* Custom Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #f59e0b 0%, #9333ea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom Button Hover Effects */
.btn-hover-lift {
    transition: all 0.3s ease;
}

.btn-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Custom Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #f59e0b 0%, #9333ea 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #d97706 0%, #7e22ce 100%);
}

/* Mobile Menu Animation */
@media (max-width: 1023px) {
    .mobile-menu-enter-active,
    .mobile-menu-leave-active {
        transition: all 0.3s ease;
    }

    .mobile-menu-enter-from,
    .mobile-menu-leave-to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Number Counter Animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Backdrop Blur Support */
@supports (backdrop-filter: blur(10px)) {
    .backdrop-blur-md {
        backdrop-filter: blur(12px);
    }

    .backdrop-blur-sm {
        backdrop-filter: blur(8px);
    }
}

/* Custom Range Input Styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(to right, #f59e0b 0%, #9333ea 100%);
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

input[type="range"]:hover {
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid #9333ea;
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid #9333ea;
}

/* Risk Level Badge Styles */
.risk-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.875rem;
}

.risk-low {
    background-color: #dcfce7;
    color: #166534;
}

.risk-medium {
    background-color: #fef3c7;
    color: #92400e;
}

.risk-high {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Platform Badge Animation */
.platform-badge {
    animation: fadeIn 0.5s ease-out;
}

/* Testimonial Card Styles */
.testimonial-card {
    position: relative;
    overflow: hidden;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 100px;
    color: rgba(147, 51, 234, 0.1);
    font-family: Georgia, serif;
    line-height: 1;
}

/* FAQ Accordion Animation */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-content.active {
    max-height: 500px;
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.5rem;
        line-height: 1.4;
    }
}

/* Chart Container Responsive */
@media (max-width: 768px) {
    #goldChart {
        height: 350px !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    header,
    footer {
        display: none !important;
    }
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #9333ea;
    outline-offset: 2px;
}

/* 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;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .text-gray-600 {
        color: #000;
    }

    .text-gray-300 {
        color: #fff;
    }
}

/* Custom Select Dropdown */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239333ea' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Floating Animation for CTA Buttons */
.float-animation {
    animation: float 3s ease-in-out infinite;
}

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

/* Shine Effect for Gold Elements */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -200%;
    }
    100% {
        left: 200%;
    }
}

/* Investment Product Card Styles */
.product-card {
    position: relative;
    transition: all 0.3s ease;
}

.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    pointer-events: none;
}

.product-card:hover::after {
    opacity: 1;
}

/* Platform Comparison Table Responsive */
@media (max-width: 1024px) {
    .platform-comparison {
        overflow-x: auto;
    }
}

/* Success Stories Carousel */
.success-story {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

.success-story:nth-child(1) { animation-delay: 0.1s; }
.success-story:nth-child(2) { animation-delay: 0.2s; }
.success-story:nth-child(3) { animation-delay: 0.3s; }

/* Custom Checkbox Styles */
input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #9333ea;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

input[type="checkbox"]:checked {
    background-color: #9333ea;
}

input[type="checkbox"]:checked::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Tooltip Styles */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background-color: #1f2937;
    color: white;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.tooltip:hover::before {
    opacity: 1;
}

/* Utility Classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.box-shadow-gold {
    box-shadow: 0 10px 40px -10px rgba(245, 158, 11, 0.5);
}

.box-shadow-purple {
    box-shadow: 0 10px 40px -10px rgba(147, 51, 234, 0.5);
}

/* Gradient Backgrounds */
.gradient-gold-purple {
    background: linear-gradient(135deg, #f59e0b 0%, #9333ea 100%);
}

.gradient-purple-gold {
    background: linear-gradient(135deg, #9333ea 0%, #f59e0b 100%);
}

/* Image Lazy Loading Effect */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Modal animation */
@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.animate-scale-in {
    animation: scale-in 0.3s ease-out;
}

/* ThinkPHP Pagination Tailwind Override */
.pagination { display: flex; justify-content: center; gap: 0.25rem; flex-wrap: wrap; }
.pagination li { display: inline-block; }
.pagination li a, .pagination li span {
    display: inline-block; padding: 0.5rem 1rem; border-radius: 0.5rem;
    font-size: 0.875rem; transition: all 0.2s;
}
.pagination li a { background: #f3f4f6; color: #374151; }
.pagination li a:hover { background: #9333ea; color: #fff; }
.pagination li.active span { background: linear-gradient(135deg, #9333ea 0%, #f59e0b 100%); color: #fff; }
.pagination li.disabled span { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
