/* =============================================
   BUDDGY AI - Custom Theme Styles
   Midnight Finance Design System
   ============================================= */

/* ------- Smooth Scrolling ------- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

/* ------- Custom Scrollbar ------- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0a0f1c;
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* ------- Glassmorphism Utilities ------- */
.glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ------- Navigation States ------- */
#site-nav.scrolled #nav-backdrop {
    background: rgba(10, 15, 28, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ------- Mobile Menu Animation ------- */
#mobile-menu.open {
    transform: translateX(0);
}

body.menu-open {
    overflow: hidden;
}

#mobile-menu-btn.open #burger-top {
    transform: rotate(45deg) translateY(4px);
}
#mobile-menu-btn.open #burger-mid {
    opacity: 0;
}
#mobile-menu-btn.open #burger-bot {
    width: 1.5rem;
    transform: rotate(-45deg) translateY(-4px);
}

/* ------- Hero Section ------- */
#hero {
    min-height: 100vh;
    min-height: 100dvh;
}

/* 3D Phone Perspective */
#phone-3d {
    transform: perspective(1200px) rotateY(-8deg) rotateX(4deg);
    transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

#phone-3d:hover {
    transform: perspective(1200px) rotateY(-2deg) rotateX(1deg) scale(1.02);
}

/* ------- Feature Card Hover Effects ------- */
.feature-card {
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ------- Section Transitions ------- */
.section-label,
.section-title,
.section-subtitle,
.feature-card,
.step-card,
.ai-feature,
.group-feature,
.security-card,
.cta-content {
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* ------- Gradient Text Shimmer ------- */
@keyframes gradient-shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-shimmer {
    background-size: 200% auto;
    animation: gradient-shimmer 3s ease infinite;
}

/* ------- Glow Effects ------- */
.glow-emerald {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.15),
                0 0 60px rgba(16, 185, 129, 0.05);
}

.glow-gold {
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.15),
                0 0 60px rgba(245, 158, 11, 0.05);
}

/* ------- Store Buttons ------- */
.store-btn {
    position: relative;
    will-change: transform;
}

.store-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.store-btn:hover::before {
    opacity: 1;
}

/* Pulsing glow on the Google Play button */
@keyframes store-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(21, 54, 106, 0.3); }
    50% { box-shadow: 0 0 35px rgba(29, 74, 138, 0.5); }
}

.store-btn[style*="linear-gradient"] {
    animation: store-glow 3s ease-in-out infinite;
}

.store-btn[style*="linear-gradient"]:hover {
    animation: none;
}

/* ------- Canvas Styles ------- */
#hero-mesh,
#ai-particles {
    pointer-events: none;
}

/* ------- AI Section Orbits ------- */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ai-orbit > div {
    animation: counter-spin 20s linear infinite;
}

@keyframes counter-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(-360deg); }
}

/* ------- Nav Link Underline Effect ------- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #10b981;
    border-radius: 1px;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ------- Responsive Adjustments ------- */
@media (max-width: 768px) {
    #phone-3d {
        transform: perspective(1200px) rotateY(0deg) rotateX(0deg);
    }
    #phone-3d:hover {
        transform: perspective(1200px) rotateY(0deg) rotateX(0deg) scale(1.02);
    }
    .floating-card-1,
    .floating-card-2 {
        display: none !important;
    }
}

/* ------- Selection Color ------- */
::selection {
    background: rgba(16, 185, 129, 0.3);
    color: white;
}

/* ------- Focus Styles for Accessibility ------- */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 4px;
    border-radius: 4px;
}

/* ------- Print Styles ------- */
@media print {
    nav, footer, canvas, .animate-float, .animate-float-delayed {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
}

/* ------- Legal Page Styles ------- */

/* Content typography */
.legal-content h2 {
    font-family: var(--font-display, 'Cabinet Grotesk', sans-serif);
    font-weight: 800;
    font-size: 1.5rem;
    color: white;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.legal-content h2::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 2px;
    background: #10b981;
    border-radius: 1px;
}

.legal-content h3 {
    font-family: var(--font-display, 'Cabinet Grotesk', sans-serif);
    font-weight: 700;
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-content p {
    color: #94a3b8;
    font-size: 0.9375rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.legal-content ul,
.legal-content ol {
    color: #94a3b8;
    font-size: 0.9375rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

.legal-content ul li::marker {
    color: #10b981;
}

.legal-content ol li::marker {
    color: #10b981;
    font-weight: 600;
}

.legal-content a {
    color: #10b981;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.3s;
}

.legal-content a:hover {
    color: #34d399;
}

.legal-content strong {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

.legal-content blockquote {
    border-left: 3px solid #10b981;
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: #cbd5e1;
    font-style: italic;
}

.legal-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

.legal-content th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    color: white;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-content td {
    padding: 0.75rem 1rem;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* TOC sidebar */
#toc-nav a,
#toc-nav-mobile a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: #64748b;
    transition: all 0.3s;
    border-left: 2px solid transparent;
}

#toc-nav a:hover,
#toc-nav-mobile a:hover {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.03);
}

#toc-nav a.active {
    color: #10b981;
    background: rgba(16, 185, 129, 0.06);
    border-left-color: #10b981;
}

/* Legal section reveal animation */
.legal-content > * {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.legal-content > .revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ------- Contact Form Styles ------- */

.contact-input::placeholder {
    color: #475569;
}

/* Select option styling fallback */
.contact-input option {
    background: #0f172a;
    color: #e2e8f0;
}

/* Form focus glow animation */
@keyframes input-glow {
    0%, 100% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.06); }
    50% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.12); }
}

.contact-input:focus {
    animation: input-glow 2s ease-in-out infinite;
}

/* ------- WordPress Specific ------- */
.custom-logo {
    max-height: 40px;
    width: auto;
}

/* Hide admin bar space */
body.admin-bar #site-nav {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar #site-nav {
        top: 46px;
    }
}

/* ------- Blog Styles ------- */

/* Post card hover */
.blog-card {
    will-change: transform;
}

/* Line clamp utility */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pagination */
.buddgy-pagination .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.buddgy-pagination .nav-links a,
.buddgy-pagination .nav-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s;
}

.buddgy-pagination .nav-links a {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}

.buddgy-pagination .nav-links a:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.buddgy-pagination .nav-links span.current {
    background: #10b981;
    color: white;
    border: 1px solid #10b981;
}

.buddgy-pagination .nav-links span.dots {
    background: transparent;
    border: none;
    color: #475569;
}

.buddgy-pagination .nav-links .prev,
.buddgy-pagination .nav-links .next {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.buddgy-pagination .nav-links .prev:hover,
.buddgy-pagination .nav-links .next:hover {
    border-color: #10b981;
    color: #10b981;
}

/* Comment list */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .children {
    list-style: none;
    padding-left: 2rem;
    margin: 0;
    border-left: 2px solid rgba(255, 255, 255, 0.04);
}

/* Comment form focus */
#commentform input:focus,
#commentform textarea:focus {
    animation: input-glow 2s ease-in-out infinite;
}

/* Avatar fallback */
.comment .avatar {
    border-radius: 9999px;
}

/* WordPress generated classes */
.wp-caption {
    max-width: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
    padding: 0.5rem 0;
}

.aligncenter {
    display: block;
    margin: 0 auto;
}

.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

/* Screen reader text (WordPress accessibility) */
.sr-only,
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Sticky post indicator */
.sticky .blog-card {
    border-color: rgba(16, 185, 129, 0.2);
}
