/**
 * Sequential Nav Pro Plugin Styles
 * Version: 3.0.0
 */

/* CSS Variables for customization */
.snp-navigation {
    --snp-primary: #007cba;
    --snp-secondary: #f8f9fa;
    --snp-text: #333333;
    --snp-radius: 8px;
    --snp-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --snp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main navigation container - Horizontal Layout (Default) */
.snp-navigation {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    margin: 40px 0;
    padding: 24px;
    background: var(--snp-secondary);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--snp-radius);
    gap: 20px;
    box-shadow: var(--snp-shadow);
    position: relative;
    animation: snpFadeIn 0.5s ease;
}

/* Navigation items */
.snp-nav-item {
    flex: 1;
    min-width: 0;
    display: flex;
}

/* Previous item alignment */
.snp-nav-prev {
    justify-content: flex-start;
}

/* Next item alignment */
.snp-nav-next {
    justify-content: flex-end;
}

/* Navigation links and disabled state */
.snp-nav-item a,
.snp-nav-item .snp-disabled {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--snp-text);
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: calc(var(--snp-radius) - 2px);
    transition: var(--snp-transition);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
}

/* Hover state */
.snp-nav-item a:hover {
    background: var(--snp-primary);
    color: white;
    border-color: var(--snp-primary);
}

.snp-nav-item a:hover .snp-arrow svg {
    transform: scale(1.1);
}

/* Arrow container */
.snp-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    margin-right: 12px;
    transition: var(--snp-transition);
}

.snp-nav-next .snp-arrow {
    margin-right: 0;
    margin-left: 12px;
    order: 2;
}

/* Arrow SVG styles */
.snp-arrow svg {
    width: 24px;
    height: 24px;
    transition: var(--snp-transition);
}

/* Content wrapper */
.snp-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.snp-nav-next .snp-content {
    text-align: right;
}

/* Label styles (Previous/Next text) */
.snp-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.snp-nav-item a:hover .snp-label {
    opacity: 0.9;
}

/* Title styles */
.snp-title {
    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Disabled state */
.snp-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    border-color: #e0e0e0;
}

.snp-disabled .snp-arrow {
    opacity: 0.3;
}

.snp-disabled .snp-title {
    font-style: italic;
    color: #999;
}

/* Layout Variations */

/* Vertical Stack Layout */
.snp-layout-vertical {
    flex-direction: column;
    gap: 16px;
}

.snp-layout-vertical .snp-nav-item {
    width: 100%;
}

.snp-layout-vertical .snp-nav-item a,
.snp-layout-vertical .snp-disabled {
    max-width: 100%;
}

/* Floating Sides Layout */
.snp-layout-floating {
    position: fixed;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    z-index: 999;
    pointer-events: none;
    box-shadow: none;
}

.snp-layout-floating .snp-nav-item {
    position: absolute;
    pointer-events: auto;
}

.snp-layout-floating .snp-nav-prev {
    left: 20px;
}

.snp-layout-floating .snp-nav-next {
    right: 20px;
}

.snp-layout-floating .snp-nav-item a,
.snp-layout-floating .snp-disabled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 60px;
    padding: 12px;
}

.snp-layout-floating .snp-content {
    display: none;
}

.snp-layout-floating .snp-nav-item a:hover .snp-content {
    display: flex;
    position: absolute;
    background: inherit;
    padding: 8px 12px;
    border-radius: var(--snp-radius);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.snp-layout-floating .snp-nav-prev a:hover .snp-content {
    left: 100%;
    margin-left: 8px;
}

.snp-layout-floating .snp-nav-next a:hover .snp-content {
    right: 100%;
    margin-right: 8px;
}

/* Compact Layout */
.snp-layout-compact {
    padding: 12px;
    margin: 20px 0;
}

.snp-layout-compact .snp-nav-item a,
.snp-layout-compact .snp-disabled {
    padding: 10px 14px;
}

.snp-layout-compact .snp-arrow {
    min-width: 24px;
    height: 24px;
    margin-right: 8px;
}

.snp-layout-compact .snp-nav-next .snp-arrow {
    margin-left: 8px;
}

.snp-layout-compact .snp-arrow svg {
    width: 18px;
    height: 18px;
}

.snp-layout-compact .snp-label {
    font-size: 10px;
    margin-bottom: 2px;
}

.snp-layout-compact .snp-title {
    font-size: 13px;
}

/* Hover Animations */

/* Lift animation */
.snp-nav-item a {
    transform: translateY(0);
}

/* Scale animation (applied via inline styles) */
/* Glow animation (applied via inline styles) */
/* Slide animation (applied via inline styles) */

/* Responsive Design */
@media (max-width: 768px) {
    .snp-navigation:not(.snp-layout-floating) {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
        margin: 30px 0;
    }
    
    .snp-navigation:not(.snp-layout-floating) .snp-nav-item {
        width: 100%;
    }
    
    .snp-navigation:not(.snp-layout-floating) .snp-nav-item a,
    .snp-navigation:not(.snp-layout-floating) .snp-disabled {
        max-width: 100%;
    }
    
    .snp-title {
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
    }
    
    /* Floating layout adjustments for mobile */
    .snp-layout-floating .snp-nav-prev {
        left: 10px;
    }
    
    .snp-layout-floating .snp-nav-next {
        right: 10px;
    }
    
    .snp-layout-floating .snp-nav-item a,
    .snp-layout-floating .snp-disabled {
        max-width: 48px;
        padding: 10px;
    }
    
    .snp-layout-floating .snp-arrow svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .snp-navigation:not(.snp-layout-floating) {
        padding: 16px;
        margin: 20px 0;
    }
    
    .snp-nav-item a,
    .snp-disabled {
        padding: 12px 16px;
    }
    
    .snp-arrow {
        min-width: 28px;
        height: 28px;
        margin-right: 10px;
    }
    
    .snp-nav-next .snp-arrow {
        margin-left: 10px;
    }
    
    .snp-arrow svg {
        width: 20px;
        height: 20px;
    }
    
    .snp-label {
        font-size: 10px;
    }
    
    .snp-title {
        font-size: 14px;
    }
    
    /* Hide labels on very small screens for floating layout */
    .snp-layout-floating .snp-nav-item a:hover .snp-content {
        display: none;
    }
}

/* Animation keyframes */
@keyframes snpFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scroll behavior when clicking navigation */
.snp-nav-item a {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.snp-nav-item a:focus {
    outline: 2px solid var(--snp-primary);
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .snp-navigation {
        --snp-secondary: #1a1a1a;
        --snp-text: #e0e0e0;
    }
    
    .snp-nav-item a {
        background: #2a2a2a;
        border-color: #3a3a3a;
    }
    
    .snp-nav-item a:hover {
        background: var(--snp-primary);
        color: white;
    }
    
    .snp-disabled {
        background: #1a1a1a;
        border-color: #2a2a2a;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .snp-navigation {
        border-width: 2px;
    }
    
    .snp-nav-item a {
        border-width: 2px;
    }
    
    .snp-nav-item a:hover {
        outline: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .snp-navigation,
    .snp-nav-item a,
    .snp-arrow,
    .snp-arrow svg,
    .snp-label {
        transition: none !important;
        animation: none !important;
    }
}

/* Print styles */
@media print {
    .snp-navigation {
        display: none;
    }
}

/* Integration with common page builders and themes */
.entry-content .snp-navigation,
.post-content .snp-navigation,
.page-content .snp-navigation,
.elementor-widget-container .snp-navigation,
.wp-block-group .snp-navigation,
.et_pb_text_inner .snp-navigation, /* Divi */
.fl-module-content .snp-navigation, /* Beaver Builder */
.wpb_wrapper .snp-navigation { /* WPBakery */
    width: 100%;
    box-sizing: border-box;
}

/* Ensure proper spacing in Gutenberg */
.wp-block-shortcode .snp-navigation {
    margin-left: 0;
    margin-right: 0;
}

/* Custom error message styling */
.snp-error {
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    margin: 20px 0;
    font-size: 14px;
}