/* 999DEX Custom Styles */

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #8b5cf6;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7c3aed;
}

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

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

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

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

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

@keyframes celebrate {
    0% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 0 0 rgba(234, 179, 8, 0);
    }
    25% {
        transform: scale(1.1) rotate(-5deg);
        box-shadow: 0 0 20px rgba(234, 179, 8, 0.5);
    }
    50% {
        transform: scale(1.2) rotate(5deg);
        box-shadow: 0 0 40px rgba(234, 179, 8, 0.8);
    }
    75% {
        transform: scale(1.1) rotate(-5deg);
        box-shadow: 0 0 20px rgba(234, 179, 8, 0.5);
    }
    100% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 0 0 rgba(234, 179, 8, 0);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(139, 92, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.8);
    }
}

@keyframes newToken {
    0% {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) translateY(0);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.slide-in {
    animation: slideIn 0.3s ease-in-out;
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

.pulse-card {
    animation: pulseScale 0.5s ease-in-out;
}

.celebrate-card {
    animation: celebrate 1.2s ease-in-out;
}

.glow-card {
    animation: glow 1.5s ease-in-out infinite;
}

.new-token {
    animation: newToken 0.6s ease-out;
}

/* Custom gradients */
.gradient-purple-cyan {
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
}

.gradient-text {
    background: linear-gradient(135deg, #a78bfa 0%, #67e8f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(139, 92, 246, 0.2),
                0 10px 10px -5px rgba(139, 92, 246, 0.1);
}

/* Button styles */
.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #0891b2 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Loading spinner */
.spinner {
    border: 4px solid rgba(139, 92, 246, 0.3);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast notification styles */
#toast {
    transition: all 0.3s ease;
}

#toast.show {
    animation: slideIn 0.3s ease;
}

/* Modal styles */
.modal-backdrop {
    backdrop-filter: blur(8px);
}

/* Chart container */
.chart-container {
    position: relative;
    height: 100%;
    width: 100%;
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
}

table tr {
    transition: background-color 0.2s ease;
}

/* Token card line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .text-responsive {
        font-size: clamp(1.5rem, 5vw, 3rem);
    }
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient border */
.gradient-border {
    position: relative;
    border-radius: 1rem;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    padding: 1px;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* Progress bar animation */
.progress-bar {
    transition: width 0.5s ease;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Status indicators */
.status-online {
    position: relative;
}

.status-online::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #0f172a;
}

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

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

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

/* Custom input focus */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Disable state */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Connection status indicator */
.connection-status {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Price change indicators */
.price-up {
    color: #10b981;
}

.price-down {
    color: #ef4444;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Chart responsive */
@media (max-width: 640px) {
    .chart-container {
        height: 250px;
    }
}

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

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

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible */
*:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    body {
        color-scheme: dark;
    }
}

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

/* Custom number input (remove arrows) */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type='number'] {
    -moz-appearance: textfield;
}

/* Loading overlay */
#loadingOverlay {
    backdrop-filter: blur(8px);
}

/* Sticky header shadow */
header.sticky {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Image loading placeholder */
img[src=''],
img:not([src]) {
    background: linear-gradient(
        90deg,
        #374151 25%,
        #4b5563 50%,
        #374151 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Error state */
.error-shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Success checkmark animation */
.success-checkmark {
    animation: checkmark 0.5s ease-in-out;
}

@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* MetaMask Enhancement Animations */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.animate-slide-down {
    animation: slideDown 0.3s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.4s ease-out;
}

/* Network warning banner styles */
#networkWarningBanner {
    animation: slideDown 0.3s ease-out;
}

/* Transaction modal backdrop */
.modal-backdrop {
    animation: fadeIn 0.2s ease-out;
}
