/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* =============================================================================
   LIBCAS Krigsbyte Charts - Base Styles
   ========================================================================== */

/* Chart Containers */
.libcas-krigsbyte-chart {
    position: relative;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.libcas-krigsbyte-chart:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Error Messages */
.libcas-krigsbyte-chart-error {
    background: #fff2cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
}

.libcas-krigsbyte-chart-error p {
    margin: 0;
    padding: 0;
}

/* =============================================================================
   Chart Slider Styles
   ========================================================================== */

.libcas-krigsbyte-slider {
    position: relative;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.slider-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slider-slide.active {
    opacity: 1;
}

/* Navigation Buttons */
.slider-prev,
.slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    border-radius: 3px;
    transition: background-color 0.3s ease;
    z-index: 10;
    user-select: none;
}

.slider-prev:hover,
.slider-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

.slider-prev:active,
.slider-next:active {
    background: rgba(0, 0, 0, 0.8);
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

/* Pagination */
.slider-pagination {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.pagination-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    user-select: none;
}

.pagination-dot:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
}

.pagination-dot.active {
    background: #007cba;
}

.pagination-dot.active:hover {
    background: #005a87;
}

/* =============================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .libcas-krigsbyte-chart,
    .libcas-krigsbyte-slider {
        margin: 10px 0;
    }
    
    .slider-prev,
    .slider-next {
        padding: 8px 12px;
        font-size: 16px;
    }
    
    .slider-prev {
        left: 5px;
    }
    
    .slider-next {
        right: 5px;
    }
    
    .slider-pagination {
        bottom: 10px;
    }
    
    .pagination-dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .slider-prev,
    .slider-next {
        display: none; /* Hide navigation on very small screens */
    }
}

/* =============================================================================
   Accessibility
   ========================================================================== */

.slider-prev:focus,
.slider-next:focus,
.pagination-dot:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .libcas-krigsbyte-chart,
    .libcas-krigsbyte-slider {
        border: 2px solid #000;
    }
    
    .slider-prev,
    .slider-next {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
    
    .pagination-dot {
        background: #000;
        border: 2px solid #fff;
    }
    
    .pagination-dot.active {
        background: #fff;
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .slider-slide {
        transition: none;
    }
    
    .slider-prev,
    .slider-next,
    .pagination-dot {
        transition: none;
    }
}

/* =============================================================================
   Theme Compatibility
   ========================================================================== */

/* Ensure charts work well with common WordPress themes */
.libcas-krigsbyte-chart *,
.libcas-krigsbyte-slider * {
    box-sizing: border-box;
}

/* Override theme button styles for navigation */
.libcas-krigsbyte-slider .slider-prev,
.libcas-krigsbyte-slider .slider-next,
.libcas-krigsbyte-slider .pagination-dot {
    font-family: inherit !important;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    background-image: none !important;
    border-image: none !important;
}

/* =============================================================================
   Custom Variables for Easy Theming
   ========================================================================== */

:root {
    --libcas-krigsbyte-chart-bg: #fff;
    --libcas-krigsbyte-chart-border: #e1e1e1;
    --libcas-krigsbyte-chart-shadow: rgba(0, 0, 0, 0.1);
    --libcas-krigsbyte-nav-bg: rgba(0, 0, 0, 0.5);
    --libcas-krigsbyte-nav-color: #fff;
    --libcas-krigsbyte-pagination-active: #007cba;
    --libcas-krigsbyte-pagination-inactive: rgba(255, 255, 255, 0.5);
    --libcas-krigsbyte-error-bg: #fff2cd;
    --libcas-krigsbyte-error-color: #856404;
    --libcas-krigsbyte-error-border: #ffeaa7;
}

/* Apply custom variables */
.libcas-krigsbyte-chart,
.libcas-krigsbyte-slider {
    background: var(--libcas-krigsbyte-chart-bg);
    border-color: var(--libcas-krigsbyte-chart-border);
    box-shadow: 0 1px 3px var(--libcas-krigsbyte-chart-shadow);
}

.slider-prev,
.slider-next {
    background: var(--libcas-krigsbyte-nav-bg);
    color: var(--libcas-krigsbyte-nav-color);
}

.pagination-dot.active {
    background: var(--libcas-krigsbyte-pagination-active);
}

.pagination-dot {
    background: var(--libcas-krigsbyte-pagination-inactive);
}

.libcas-krigsbyte-chart-error {
    background: var(--libcas-krigsbyte-error-bg);
    color: var(--libcas-krigsbyte-error-color);
    border-color: var(--libcas-krigsbyte-error-border);
}