/* Reset and Base Styles - Optimized for Performance */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Critical CSS - Above the fold optimization */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98D8E8 25%, #B19CD9 50%, #DDA0DD 75%, #F0B2D6 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #000;
    overflow-x: hidden;
    will-change: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Performance optimized animations */
@media (prefers-reduced-motion: no-preference) {
    * {
        transition-duration: 0.2s;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Optimized Glass Morphism Effects */
.glass-card {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    will-change: transform;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Fast fade-in animation for cards */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

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

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }

/* Feature item animations */
.feature-item {
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.6s ease forwards;
}

.feature-item:nth-child(1) { animation-delay: 0.1s; }
.feature-item:nth-child(2) { animation-delay: 0.2s; }
.feature-item:nth-child(3) { animation-delay: 0.3s; }
.feature-item:nth-child(4) { animation-delay: 0.4s; }

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

/* Hover effects for interactive elements */
.balance-card:hover,
.stat-card:hover,
.action-card:hover,
.stake-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
}

/* Smooth page loading animation */
.page-container {
    opacity: 0;
    animation: pageLoad 0.8s ease forwards;
}

@keyframes pageLoad {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Enhanced button animations */
.gradient-button,
.glass-button {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.gradient-button:active,
.glass-button:active {
    transform: scale(0.95) translateZ(0);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tab transitions */
.tab-content {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.hidden {
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
}

/* Enhanced card interactions */
.coin-card:hover,
.coin-info:hover,
.transaction-item:hover {
    transform: translateY(-2px) translateZ(0);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Micro-interactions for form elements */
input:focus,
select:focus,
textarea:focus {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Optimized for mobile performance */
@media (max-width: 768px) {
    .fade-in,
    .feature-item {
        animation-duration: 0.4s;
    }
    
    .glass-card:hover {
        transform: none;
    }
    
    .balance-card:hover,
    .stat-card:hover,
    .action-card:hover {
        transform: translateY(-1px) scale(1.01);
    }
}

/* Support Chat Button Styles */
.support-chat-btn {
    position: relative;
    animation: pulse-glow 2s ease-in-out infinite;
}

.support-chat-btn:hover {
    transform: scale(1.1);
    animation: none;
}

.support-chat-btn:hover + #chatBubble {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-5px);
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(147, 51, 234, 0.6);
    }
    100% {
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    }
}

/* Support Chat Modal */
.support-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.support-modal.active {
    opacity: 1;
    visibility: visible;
}

.support-modal-content {
    background: linear-gradient(135deg, rgba(15, 15, 35, 0.95) 0%, rgba(26, 26, 64, 0.95) 50%, rgba(45, 27, 105, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.8) translateY(50px);
    transition: all 0.3s ease;
}

.support-modal.active .support-modal-content {
    transform: scale(1) translateY(0);
}

/* Floating notification */
.support-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1100;
}

.support-notification.show {
    transform: translateX(0);
}

/* Gradient Buttons */
.gradient-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.gradient-button::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;
}

.gradient-button:hover::before {
    left: 100%;
}

.gradient-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.glass-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Glow Effects */
.glow {
    filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5));
}

.glow-text {
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

/* Navigation */
.nav-item.active {
    color: #667eea !important;
    filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.6));
}

/* Cards and Components */
.balance-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.02);
}

.feature-card {
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(31, 38, 135, 0.5);
}

.action-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(31, 38, 135, 0.4);
}

/* Partner Slider */
.partner-slider {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.partner-logo {
    display: inline-block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    font-weight: 600;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

.partner-logo:hover {
    color: white;
    transform: scale(1.05);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.animate-scroll {
    animation: scroll 30s linear infinite;
}

/* Blockchain Animation */
.blockchain-animation {
    position: relative;
    animation: float 6s ease-in-out infinite;
}

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

/* Social Icons */
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.social-icon:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Form Styles */
.form-group input,
.form-group select,
.form-group textarea {
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tab Styles */
.tab-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: rgba(102, 126, 234, 0.5);
}

.tab-button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Flash Messages */
.flash-messages {
    animation: slideInRight 0.5s ease-out;
}

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

.flash-message {
    animation: flashFadeIn 0.5s ease-out forwards;
}

@keyframes flashFadeIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Coin Selection */
.coin-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.coin-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.coin-card.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    border-color: rgba(102, 126, 234, 0.5);
}

/* Stake Items */
.stake-item {
    transition: all 0.3s ease;
}

.stake-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Transaction Items */
.transaction-item {
    transition: all 0.3s ease;
}

.transaction-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .glass-card {
        padding: 1rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .partner-logo {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
}

/* Admin Specific Styles */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section h2 {
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    padding-bottom: 0.5rem;
}

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

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4c93 100%);
}

/* QR Code Styles */
.qr-code {
    display: inline-block;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Animation Delays for Staggered Effects */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Pulse Animation for Important Elements */
.pulse {
    animation: pulse 2s infinite;
}

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

/* Success/Error States */
.success-state {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(22, 163, 74, 0.2) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.error-state {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.warning-state {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.2) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
}
