
/**
 * ACF Flatsome TB Styles
 *
 * @package ACF_Flatsome_TB
 */

/* ========================================
   Universal ACF Field Styles
   ======================================== */

.acf-universal-field {
    display: block;
    margin-bottom: 1em;
}

.acf-universal-field .acf-field-label {
    font-weight: 600;
    margin-bottom: 0.5em;
    display: block;
}

.acf-universal-field .acf-field-value {
    display: inline-block;
}

.acf-universal-field .acf-before-text,
.acf-universal-field .acf-after-text {
    display: inline;
}

/* Text Fields */
.acf-text-field,
.acf-choice-field {
    display: inline;
}

/* WYSIWYG Field */
.acf-wysiwyg-field {
    line-height: 1.6;
}

.acf-wysiwyg-field p {
    margin-bottom: 1em;
}

.acf-wysiwyg-field ul,
.acf-wysiwyg-field ol {
    margin-left: 2em;
    margin-bottom: 1em;
}

/* Image Field */
.acf-image-field {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Gallery Field - Grid Mode */
.acf-gallery-field.acf-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 1em;
}

.acf-gallery-field.acf-gallery-grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 3px;
}

/* ========================================
   Advanced Gallery Slider Styles
   ======================================== */

/* Slider Wrapper */
.acf-gallery-slider-wrapper {
    position: relative;
    margin: 0 auto 2em;
    overflow: hidden;
}

/* Slider Container */
.acf-slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* When using aspect ratio */
.acf-gallery-slider-wrapper[style*="padding-bottom"] .acf-slider-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Slider Track */
.acf-slider-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

/* Individual Slide */
.acf-slider-slide {
    position: relative;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}

.acf-slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Slide Overlay */
.acf-slider-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.acf-slider-slide:hover .acf-slider-overlay {
    opacity: 0.5;
}

/* Slide Caption */
.acf-slider-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
    z-index: 2;
    font-size: 14px;
    line-height: 1.5;
}

/* Navigation Arrows */
.acf-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.acf-slider-arrow:hover {
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: translateY(-50%) scale(1.1);
}

.acf-slider-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.acf-slider-arrow svg {
    width: 24px;
    height: 24px;
    color: #333;
}

.acf-slider-prev {
    left: 20px;
}

.acf-slider-next {
    right: 20px;
}

/* Arrow Styles */
.acf-slider-arrows-circle .acf-slider-arrow {
    border-radius: 50%;
}

.acf-slider-arrows-square .acf-slider-arrow {
    border-radius: 4px;
}

.acf-slider-arrows-minimal .acf-slider-arrow {
    background: transparent;
    box-shadow: none;
}

.acf-slider-arrows-minimal .acf-slider-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}

.acf-slider-arrows-minimal .acf-slider-arrow svg {
    color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Dots Navigation */
.acf-slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px 0;
    margin: 0;
}

.acf-slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.acf-slider-dot:hover {
    background: #999;
    transform: scale(1.2);
}

.acf-slider-dot.active {
    background: #333;
    width: 30px;
    border-radius: 6px;
}

/* Thumbnail Navigation */
.acf-slider-thumbnails {
    display: flex;
    gap: 10px;
    padding: 15px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #999 #f5f5f5;
}

.acf-slider-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.acf-slider-thumbnails::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.acf-slider-thumbnails::-webkit-scrollbar-thumb {
    background: #999;
    border-radius: 3px;
}

.acf-slider-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.acf-slider-thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
}

.acf-slider-thumbnail.active {
    border-color: #333;
    opacity: 1;
}

.acf-slider-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Thumbnail Positions */
.acf-thumbnails-top .acf-slider-thumbnails {
    order: -1;
    padding-bottom: 15px;
}

.acf-thumbnails-bottom .acf-slider-thumbnails {
    padding-top: 15px;
}

.acf-slider-has-thumbnails.acf-thumbnails-left,
.acf-slider-has-thumbnails.acf-thumbnails-right {
    display: flex;
    gap: 15px;
}

.acf-thumbnails-left .acf-slider-thumbnails {
    flex-direction: column;
    order: -1;
    width: 100px;
    padding-right: 15px;
}

.acf-thumbnails-right .acf-slider-thumbnails {
    flex-direction: column;
    width: 100px;
    padding-left: 15px;
}

.acf-thumbnails-left .acf-slider-thumbnail,
.acf-thumbnails-right .acf-slider-thumbnail {
    width: 100%;
    height: 75px;
}

/* Shadow Effects */
.acf-slider-shadow-small {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.acf-slider-shadow-medium {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.acf-slider-shadow-large {
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.acf-slider-shadow-xlarge {
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

/* ========================================
   Slider Effects
   ======================================== */

/* Fade Effect */
.acf-slider-effect-fade .acf-slider-track {
    display: block;
    position: relative;
}

.acf-slider-effect-fade .acf-slider-slide {
    transition: opacity 0.5s ease-in-out;
}

/* Zoom Effect */
.acf-slider-effect-zoom .acf-slider-track {
    display: block;
    position: relative;
}

.acf-slider-effect-zoom .acf-slider-slide {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

/* Blur Effect */
.acf-slider-effect-blur .acf-slider-track {
    display: block;
    position: relative;
}

.acf-slider-effect-blur .acf-slider-slide {
    transition: opacity 0.5s ease-in-out, filter 0.5s ease-in-out;
}

/* Flip Effect */
.acf-slider-effect-flip .acf-slider-track {
    display: block;
    position: relative;
    perspective: 1000px;
}

.acf-slider-effect-flip .acf-slider-slide {
    transition: opacity 0.5s ease-in-out, transform 0.6s ease-in-out;
    transform-style: preserve-3d;
}

/* Carousel Mode */
.acf-gallery-carousel .acf-slider-track {
    padding: 20px 0;
}

.acf-gallery-carousel .acf-slider-slide {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.acf-gallery-carousel .acf-slider-slide:not(.active) {
    transform: scale(0.85);
    opacity: 0.5;
}

.acf-gallery-carousel .acf-slider-slide.active {
    transform: scale(1);
    opacity: 1;
    z-index: 2;
}

/* ========================================
   Loading State
   ======================================== */

.acf-slider-slide img[data-lazy] {
    background: linear-gradient(
        90deg,
        #f5f5f5 25%,
        #e0e0e0 50%,
        #f5f5f5 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media screen and (max-width: 768px) {
    .acf-slider-arrow {
        width: 40px;
        height: 40px;
    }
    
    .acf-slider-arrow svg {
        width: 20px;
        height: 20px;
    }
    
    .acf-slider-prev {
        left: 10px;
    }
    
    .acf-slider-next {
        right: 10px;
    }
    
    .acf-slider-caption {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .acf-slider-thumbnail {
        width: 60px;
        height: 45px;
    }
    
    /* Stack thumbnails on mobile for left/right positions */
    .acf-slider-has-thumbnails.acf-thumbnails-left,
    .acf-slider-has-thumbnails.acf-thumbnails-right {
        flex-direction: column;
    }
    
    .acf-thumbnails-left .acf-slider-thumbnails,
    .acf-thumbnails-right .acf-slider-thumbnails {
        flex-direction: row;
        width: 100%;
        order: 1;
        padding: 15px 0 0 0;
    }
    
    .acf-thumbnails-left .acf-slider-thumbnail,
    .acf-thumbnails-right .acf-slider-thumbnail {
        width: 60px;
        height: 45px;
    }
}

@media screen and (max-width: 480px) {
    .acf-slider-arrow {
        width: 32px;
        height: 32px;
    }
    
    .acf-slider-arrow svg {
        width: 16px;
        height: 16px;
    }
    
    .acf-slider-dot {
        width: 8px;
        height: 8px;
    }
    
    .acf-slider-dot.active {
        width: 20px;
    }
}

/* File Field */
.acf-file-field {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f5f5f5;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s;
}

.acf-file-field:hover {
    background-color: #e0e0e0;
}

/* Link Field */
.acf-link-field {
    display: inline-block;
    text-decoration: underline;
    transition: color 0.3s;
}

.acf-link-field:hover {
    opacity: 0.8;
}

/* Post Field */
.acf-post-field a {
    display: inline-block;
    margin-right: 0.5em;
}

/* Taxonomy Field */
.acf-taxonomy-field a {
    display: inline-block;
    margin-right: 0.5em;
}

/* Map Field */
.acf-map-field {
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 3px;
    border: 1px solid #ddd;
}

/* Date Field */
.acf-date-field {
    display: inline-block;
}

/* Color Field */
.acf-color-field {
    border: 1px solid #ddd;
}

/* Repeater Field */
.acf-repeater-field {
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
}

.acf-repeater-row {
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

.acf-repeater-row:last-child {
    border-bottom: none;
}

.acf-repeater-item {
    margin-bottom: 10px;
}

.acf-repeater-item:last-child {
    margin-bottom: 0;
}

.acf-repeater-item strong {
    display: inline-block;
    min-width: 120px;
}

/* Group Field */
.acf-group-field {
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 15px;
}

.acf-group-item {
    margin-bottom: 10px;
}

.acf-group-item:last-child {
    margin-bottom: 0;
}

.acf-group-item strong {
    display: inline-block;
    min-width: 120px;
}

/* oEmbed Field */
.acf-oembed-field {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.acf-oembed-field iframe,
.acf-oembed-field object,
.acf-oembed-field embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Flexible Content Field */
.acf-flexible-content-field {
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
}

.acf-flexible-layout {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    background-color: #fafafa;
}

.acf-flexible-layout:last-child {
    border-bottom: none;
}

.acf-flexible-item {
    margin-bottom: 10px;
}

.acf-flexible-item:last-child {
    margin-bottom: 0;
}

.acf-flexible-item strong {
    display: inline-block;
    min-width: 120px;
}

.acf-flexible-item pre {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 3px;
    overflow-x: auto;
    font-size: 12px;
}

/* Message Field */
.acf-message-field {
    padding: 12px 15px;
    background-color: #f0f6fc;
    border: 1px solid #d0e3f1;
    border-radius: 3px;
    color: #0969da;
}

/* Array Field */
.acf-array-field {
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 15px;
    background-color: #fafafa;
}

.acf-array-item {
    margin-bottom: 10px;
    padding-left: 15px;
}

.acf-array-item:last-child {
    margin-bottom: 0;
}

.acf-array-item strong {
    display: inline-block;
    min-width: 120px;
}

.acf-array-item .acf-array-field {
    margin-top: 10px;
    margin-left: 20px;
    border-left: 3px solid #ddd;
}

/* Default Field */
.acf-field-default {
    display: inline;
}

/* ========================================
   Taxonomy Element Styles
   ======================================== */

.acf-taxonomy-element {
    display: block;
    margin-bottom: 1em;
}

/* List Style */
.acf-taxonomy-list .acf-taxonomy-item {
    display: block;
    margin-bottom: 0.5em;
}

/* Grid Style */
.acf-taxonomy-grid {
    display: grid;
}

.acf-taxonomy-grid .acf-taxonomy-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Tags Style */
.acf-taxonomy-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.acf-taxonomy-tags .acf-taxonomy-item {
    display: inline-block;
    padding: 5px 12px;
    background-color: #f5f5f5;
    border-radius: 20px;
    transition: background-color 0.3s;
}

.acf-taxonomy-tags .acf-taxonomy-item:hover {
    background-color: #e0e0e0;
}

.acf-taxonomy-tags .acf-taxonomy-item a {
    text-decoration: none;
}

/* Dropdown Style */
.acf-taxonomy-dropdown {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.acf-taxonomy-dropdown:focus {
    outline: none;
    border-color: #999;
}

/* Taxonomy Item Common Styles */
.acf-taxonomy-item a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.acf-taxonomy-count {
    font-size: 0.9em;
    opacity: 0.7;
}

.acf-taxonomy-description {
    font-size: 0.9em;
    margin-top: 0.3em;
    opacity: 0.8;
}

.acf-taxonomy-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 8px;
}

/* ========================================
   Responsive Styles
   ======================================== */

@media screen and (max-width: 768px) {
    .acf-gallery-field {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .acf-taxonomy-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .hide-for-small {
        display: none !important;
    }

    .show-for-small {
        display: block !important;
    }
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .hide-for-medium {
        display: none !important;
    }

    .show-for-medium {
        display: block !important;
    }
}

@media screen and (min-width: 1025px) {
    .show-for-small,
    .show-for-medium {
        display: none !important;
    }
}

/* ========================================
   Animation Classes
   ======================================== */

.animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fadeIn {
    animation-name: fadeIn;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fadeInUp {
    animation-name: fadeInUp;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fadeInDown {
    animation-name: fadeInDown;
}

@keyframes slideInUp {
    from {
        transform: translate3d(0, 100%, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

.slideInUp {
    animation-name: slideInUp;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    50% {
        opacity: 1;
    }
}

.zoomIn {
    animation-name: zoomIn;
}

/* ========================================
   Utility Classes
   ======================================== */

.acf-center {
    text-align: center;
}

.acf-left {
    text-align: left;
}

.acf-right {
    text-align: right;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .acf-universal-field,
    .acf-taxonomy-element {
        page-break-inside: avoid;
    }
}
