/* Novafinanceprotocol - Web3 Platform Styles */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Navigation styles */
.nav-link {
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    position: relative;
}

.nav-link:hover {
    color: #3B82F6;
}

.nav-link.active {
    color: #3B82F6;
    border-bottom-color: #3B82F6;
}

/* Hero section enhancements */
.hero-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hero-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
}

/* Project card styles */
.project-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.project-card .project-image {
    transition: transform 0.3s ease;
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

/* Project status badges */
.project-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-live {
    background-color: #10B981;
    color: white;
}

.status-coming-soon {
    background-color: #F59E0B;
    color: white;
}

.status-hot {
    background-color: #EF4444;
    color: white;
}

/* Progress bars */
.progress-bar {
    background: linear-gradient(90deg, #3B82F6 0%, #06B6D4 100%);
    height: 0.5rem;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

/* Staking interface */
.staking-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.dark .staking-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

.staking-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.staking-input {
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}

.staking-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dark .staking-input {
    border-color: #475569;
    background-color: #1e293b;
}

.dark .staking-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Governance panels */
.governance-panel {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.governance-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.voting-bar {
    background: linear-gradient(90deg, #10B981 0%, #059669 100%);
    height: 0.5rem;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

/* Community section */
.community-icon {
    transition: all 0.3s ease;
}

.community-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

.community-stats {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Wallet modal */
.wallet-modal {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.wallet-option-btn {
    transition: all 0.3s ease;
}

.wallet-option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Button enhancements */
.btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary::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;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Gradient text effects */
.gradient-text {
    background: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    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 float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Animation classes */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Responsive design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 3rem;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Dark mode enhancements */
.dark {
    color-scheme: dark;
}

.dark .project-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

.dark .staking-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

.dark .governance-panel {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

/* Focus states for accessibility */
.btn-primary:focus,
.staking-input:focus,
.wallet-option-btn:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

/* Disabled states */
.btn-primary:disabled,
.staking-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Grid pattern background */
.bg-grid-pattern {
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Enhanced hover effects */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Smooth transitions */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

/* Print styles */
@media print {
    .project-card,
    .staking-card,
    .governance-panel,
    .wallet-modal,
    #darkModeToggle,
    #notificationToast {
        display: none !important;
    }
}

/* Custom scrollbar for webkit browsers */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark .custom-scrollbar::-webkit-scrollbar-track {
    background: #1e293b;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Wallet modal scrollbar styles */
#walletModal .max-h-96::-webkit-scrollbar {
    width: 8px;
}

#walletModal .max-h-96::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#walletModal .max-h-96::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#walletModal .max-h-96::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark #walletModal .max-h-96::-webkit-scrollbar-track {
    background: #1e293b;
}

.dark #walletModal .max-h-96::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark #walletModal .max-h-96::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Z-index management and layering */
nav {
    z-index: 1000;
}

#walletModal {
    z-index: 2000;
}

#notificationToast {
    z-index: 1500;
}

/* Smooth scrolling improvements */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for fixed navigation */
}

/* Fix section overlapping issues */
section {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0;
    overflow: visible;
}

/* Ensure each section has proper spacing and doesn't overlap */
section:not(:last-of-type) {
    margin-bottom: 0;
}

/* Specific section fixes */
#home {
    z-index: 1;
    position: relative;
}

#projects {
    z-index: 2;
    position: relative;
    background: white;
}

#staking {
    z-index: 3;
    position: relative;
    background: #f8fafc;
}

#governance {
    z-index: 4;
    position: relative;
    background: white;
}

#features {
    z-index: 5;
    position: relative;
    background: white;
}

#roadmap {
    z-index: 6;
    position: relative;
    background: #f8fafc;
}

#community {
    z-index: 7;
    position: relative;
    background: #f8fafc;
}

/* Dark mode section backgrounds */
.dark #projects,
.dark #governance,
.dark #features {
    background: #1E293B !important;
}

.dark #staking,
.dark #roadmap,
.dark #community {
    background: #0F172A !important;
}

/* Enhanced navigation styles */
.nav-link {
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    position: relative;
    cursor: pointer;
}

.nav-link:hover {
    color: #3B82F6;
}

.nav-link.active {
    color: #3B82F6;
    border-bottom-color: #3B82F6;
}

/* Timeline styles for roadmap */
.timeline-line {
    background: linear-gradient(to bottom, #3B82F6, #06B6D4);
}

.timeline-dot {
    border: 4px solid white;
    box-shadow: 0 0 0 2px #3B82F6;
}

.dark .timeline-dot {
    border-color: #0F172A;
    box-shadow: 0 0 0 2px #3B82F6;
}

/* Fix for overlapping elements */
.project-card,
.staking-card,
.governance-panel,
.feature-card {
    position: relative;
    z-index: 2;
}

/* Improved modal backdrop */
.modal-backdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Enhanced button interactions */
.btn-primary,
.wallet-option-btn,
.project-card button {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before,
.wallet-option-btn::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;
    z-index: -1;
}

.btn-primary:hover::before,
.wallet-option-btn:hover::before {
    left: 100%;
}

/* Responsive navigation improvements */
@media (max-width: 768px) {
    .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .nav-link.active {
        border-left-color: #3B82F6;
        border-bottom: none;
    }
}

/* Enhanced scroll animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Improved focus states */
.nav-link:focus,
.btn-primary:focus,
.wallet-option-btn:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Enhanced hover effects */
.project-card:hover,
.staking-card:hover,
.governance-panel:hover,
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.dark .project-card:hover,
.dark .staking-card:hover,
.dark .governance-panel:hover,
.dark .feature-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Timeline responsive design */
@media (max-width: 768px) {
    .timeline-line {
        left: 2rem;
    }
    
    .timeline-item {
        flex-direction: column;
        text-align: left;
        padding-left: 4rem;
    }
    
    .timeline-dot {
        left: 2rem;
    }
}

/* Staking section fixes */
#staking {
    position: relative;
    z-index: 3;
    overflow: visible;
}

#staking .grid {
    align-items: start;
}

#staking .bg-white,
#staking .bg-dark-secondary {
    height: fit-content;
}

/* Fix for staking pool card */
.staking-pool-card {
    position: sticky;
    top: 100px;
}

/* Prevent content overflow */
.project-card,
.staking-card,
.governance-panel,
.feature-card {
    position: relative;
    z-index: 2;
    overflow: hidden;
}

/* Enhanced spacing for staking features */
#staking .grid-cols-1.md\:grid-cols-3 {
    gap: 2rem;
}

@media (max-width: 768px) {
    #staking .grid-cols-1.md\:grid-cols-3 {
        gap: 1.5rem;
    }
}

/* Ensure footer doesn't get jammed */
footer {
    position: relative;
    z-index: 10;
    margin-top: 0;
}

/* Fix for any potential grid issues */
.grid {
    display: grid;
    grid-template-columns: repeat(var(--tw-grid-cols, 1), minmax(0, 1fr));
}

/* Prevent flexbox issues in staking section */
#staking .flex {
    display: flex;
}

#staking .flex-shrink-0 {
    flex-shrink: 0;
}

/* Additional fixes for section layering */
main {
    position: relative;
    z-index: 1;
}

/* Ensure proper background colors for sections */
.bg-white {
    background-color: white !important;
}

.bg-dark-secondary {
    background-color: #1E293B !important;
}

.bg-gradient-to-br.from-gray-50.to-blue-50 {
    background: linear-gradient(to bottom right, #f8fafc, #eff6ff) !important;
}

.dark .bg-gradient-to-br.from-gray-50.to-blue-50 {
    background: linear-gradient(to bottom right, #0F172A, #1E293B) !important;
}

.dark .bg-gradient-to-br.from-dark.to-dark-secondary {
    background: linear-gradient(to bottom right, #0F172A, #1E293B) !important;
}

/* Fix for any transform issues */
section {
    transform: none !important;
    will-change: auto;
}

/* Ensure proper stacking context */
.py-20 {
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
}

/* Enhanced dark mode styling */
.dark body {
    background-color: #0F172A !important;
    color: #f1f5f9 !important;
}

.dark .bg-white {
    background-color: #1E293B !important;
}

.dark .bg-gray-50 {
    background-color: #0F172A !important;
}

.dark .bg-gray-100 {
    background-color: #1E293B !important;
}

.dark .bg-gray-200 {
    background-color: #334155 !important;
}

.dark .bg-gray-300 {
    background-color: #475569 !important;
}

.dark .bg-gray-400 {
    background-color: #64748b !important;
}

.dark .bg-gray-500 {
    background-color: #94a3b8 !important;
}

.dark .bg-gray-600 {
    background-color: #cbd5e1 !important;
}

.dark .bg-gray-700 {
    background-color: #e2e8f0 !important;
}

.dark .bg-gray-800 {
    background-color: #f1f5f9 !important;
}

.dark .bg-gray-900 {
    background-color: #f8fafc !important;
}

/* Dark mode text colors */
.dark .text-gray-900 {
    color: #f8fafc !important;
}

.dark .text-gray-800 {
    color: #f1f5f9 !important;
}

.dark .text-gray-700 {
    color: #e2e8f0 !important;
}

.dark .text-gray-600 {
    color: #cbd5e1 !important;
}

.dark .text-gray-500 {
    color: #94a3b8 !important;
}

.dark .text-gray-400 {
    color: #64748b !important;
}

.dark .text-gray-300 {
    color: #475569 !important;
}

.dark .text-gray-200 {
    color: #334155 !important;
}

.dark .text-gray-100 {
    color: #1E293B !important;
}

.dark .text-gray-50 {
    color: #0F172A !important;
}

/* Dark mode border colors */
.dark .border-gray-200 {
    border-color: #334155 !important;
}

.dark .border-gray-300 {
    border-color: #475569 !important;
}

.dark .border-gray-400 {
    border-color: #64748b !important;
}

.dark .border-gray-500 {
    border-color: #94a3b8 !important;
}

.dark .border-gray-600 {
    border-color: #cbd5e1 !important;
}

.dark .border-gray-700 {
    border-color: #e2e8f0 !important;
}

.dark .border-gray-800 {
    border-color: #f1f5f9 !important;
}

/* Dark mode card backgrounds */
.dark .bg-gradient-to-br.from-blue-50.to-cyan-50 {
    background: linear-gradient(to bottom right, #0c4a6e, #0e7490) !important;
}

.dark .bg-gradient-to-br.from-green-50.to-emerald-50 {
    background: linear-gradient(to bottom right, #064e3b, #065f46) !important;
}

.dark .bg-gradient-to-br.from-purple-50.to-pink-50 {
    background: linear-gradient(to bottom right, #581c87, #831843) !important;
}

.dark .bg-gradient-to-br.from-orange-50.to-red-50 {
    background: linear-gradient(to bottom right, #7c2d12, #991b1b) !important;
}

/* Dark mode input styling */
.dark input[type="number"] {
    background-color: #1E293B !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

.dark input[type="number"]:focus {
    border-color: #3B82F6 !important;
    ring-color: #3B82F6 !important;
}

/* Dark mode button hover states */
.dark .bg-white:hover {
    background-color: #334155 !important;
}

.dark .bg-gray-100:hover {
    background-color: #475569 !important;
}

.dark .bg-gray-800:hover {
    background-color: #64748b !important;
}

/* Dark mode shadow adjustments */
.dark .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2) !important;
}

.dark .shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3) !important;
}
