/*
 * Landing Page Polish & Micro-interactions
 * Additional visual refinements and attention to detail
 */

/* Improved text rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Better focus indicators */
:focus {
    outline: 2px solid var(--theme-primary);
    outline-offset: 3px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Refined hover states for interactive elements */
a, button, .card, .badge-custom {
    -webkit-tap-highlight-color: transparent;
}

/* Status bar enhancements */
.status-bar {
    position: relative;
    z-index: 1031;
}



/* Enhanced gradient text with better fallback */

@supports not (background-clip: text) {
    .gradient-text {
        color: var(--theme-primary);
    }
}

/* Improved card stacking on hover */
.card {
    transform-style: preserve-3d;
}

.card-body {
    transform: translateZ(10px);
}

/* Better icon transitions */
svg {
    will-change: transform;
    transition: transform var(--timing-normal) cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Refined scroll arrow */
.scroll-arrow {
    position: relative;
    z-index: 10;
}

.scroll-arrow svg {
    filter: drop-shadow(0 0 10px var(--theme-glow));
}

/* Enhanced form focus states */
.form-control {
    position: relative;
}

.form-control:focus {
    z-index: 2;
}

/* Improved button pressed state */
.btn:active {
    transform: translateY(1px) !important;
}

/* Better alert positioning */
.alert {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Refined section separators */
.section-full {
    position: relative;
    isolation: isolate;
}

/* Enhanced modal backdrop */
.modal-backdrop {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Better theme selector interaction */
.theme-preview {
    transition: transform var(--timing-normal);
}

.theme-option:hover .theme-preview {
    transform: scale(1.05);
}

/* Improved navbar dropdown on mobile */
@media (max-width: 991px) {
    .navbar-collapse {
        background: var(--theme-card);
        border: 1px solid var(--theme-border);
        border-top: 2px solid var(--theme-primary);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        padding: var(--space-4);
        margin-top: var(--space-3);
    }
    
    .nav-link::after {
        display: none;
    }
    
    .navbar-nav {
        gap: var(--space-2);
    }
}

/* Enhanced loading states */
@keyframes shimmerLoad {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    background: linear-gradient(
        90deg,
        var(--theme-card) 0%,
        var(--theme-border) 50%,
        var(--theme-card) 100%
    );
    background-size: 1000px 100%;
    animation: shimmerLoad 2s infinite;
}

/* Refined typography hierarchy */
.lead {
    font-weight: 400;
    line-height: var(--lh-normal);
    color: var(--theme-text-secondary);
}

.lead strong {
    color: var(--theme-text-primary);
    font-weight: 600;
}

/* Better visual separation */
hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--theme-border), transparent);
    margin: var(--space-6) 0;
}

/* Enhanced container spacing */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Improved grid gaps */
.row.g-4 {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

@media (min-width: 768px) {
    .row.g-4 {
        --bs-gutter-x: 2rem;
        --bs-gutter-y: 2rem;
    }
}

/* Better visual hierarchy for sections */
.section-full:nth-child(odd) {
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.1) 50%,
        transparent 100%
    );
}

/* Enhanced CTA section */
.cta-section {
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    pointer-events: none;
}

/* Refined footer */
footer {
    position: relative;
}

/* Better image rendering (if images are added) */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Enhanced list styles */
ul {
    list-style: none;
    padding: 0;
}

/* Refined code blocks (if needed) */
code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--theme-card);
    border: 1px solid var(--theme-border);
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 0.9em;
}

/* Better table styles (if needed) */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--theme-border);
    text-align: left;
}

th {
    background: var(--theme-card);
    font-weight: 600;
    color: var(--theme-primary);
}

/* Enhanced blockquote */
blockquote {
    border-left: 3px solid var(--theme-primary);
    padding-left: var(--space-4);
    margin: var(--space-5) 0;
    font-style: italic;
    color: var(--theme-text-secondary);
}

/* Refined badge styles */
.badge {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: var(--font-xs);
    padding: var(--space-1) var(--space-2);
}

/* Better tooltip positioning (if tooltips are added) */
.tooltip {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--font-xs);
}

/* Enhanced accessibility */
.visually-hidden:not(:focus):not(:active) {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--theme-primary);
    color: var(--theme-bg);
    padding: var(--space-2) var(--space-4);
    text-decoration: none;
    z-index: 9999;
    transition: top var(--timing-fast);
}

.skip-to-content:focus {
    top: 0;
}

/* Better print styles */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    h2,
    h3,
    p {
        orphans: 3;
        widows: 3;
    }
    
    h2,
    h3 {
        page-break-after: avoid;
    }
}
