/**
 * Theme Modules CSS
 * Styles for all page builder module renderers
 * @created 2026-02-16
 */

/* =============================================
   IMAGE SLIDER
   ============================================= */
.tm-image-slider {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}
.tm-slider-track {
    display: flex;
    transition: transform 0.5s ease;
}
.tm-slider-slide {
    min-width: 100%;
    position: relative;
}
.tm-slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tm-slider-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 14px;
}
.tm-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 5;
}
.tm-slider-nav:hover { background: rgba(0,0,0,0.8); }
.tm-slider-prev { left: 12px; }
.tm-slider-next { right: 12px; }
.tm-slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}
.tm-slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.tm-slider-dot.active { background: #fff; transform: scale(1.2); }

/* =============================================
   VIDEO SLIDER
   ============================================= */
.tm-video-slider {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}
.tm-video-track {
    display: flex;
    transition: transform 0.5s ease;
}
.tm-video-slide {
    min-width: 100%;
    position: relative;
}
.tm-video-slide video,
.tm-video-slide iframe {
    width: 100%;
    aspect-ratio: 16/9;
    display: block;
    border: none;
}
.tm-video-thumbnail {
    position: relative;
    cursor: pointer;
}
.tm-video-thumbnail img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}
.tm-video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: rgba(139, 92, 246, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s;
}
.tm-video-thumbnail:hover .tm-video-play-btn {
    background: #8b5cf6;
    transform: translate(-50%, -50%) scale(1.1);
}

/* =============================================
   PHOTO GALLERY
   ============================================= */
.tm-photo-gallery { border-radius: 12px; overflow: hidden; }
.tm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 3), 1fr);
    gap: var(--gap, 8px);
}
.tm-gallery-masonry {
    columns: var(--columns, 3);
    column-gap: var(--gap, 8px);
}
.tm-gallery-masonry .tm-gallery-item {
    break-inside: avoid;
    margin-bottom: var(--gap, 8px);
}
.tm-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}
.tm-gallery-item img {
    width: 100%;
    display: block;
    transition: transform 0.3s;
}
.tm-gallery-item:hover img { transform: scale(1.05); }
.tm-gallery-link { display: block; cursor: zoom-in; }
.tm-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: #fff;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.3s;
}
.tm-gallery-item:hover .tm-gallery-caption { opacity: 1; }

/* Lightbox */
.tm-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.tm-lightbox.active { display: flex; }
.tm-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 10001;
}
.tm-lightbox-prev,
.tm-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    z-index: 10001;
}
.tm-lightbox-prev { left: 16px; }
.tm-lightbox-next { right: 16px; }
.tm-lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}
.tm-lightbox-caption {
    color: #ccc;
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
}

/* =============================================
   COUNTDOWN
   ============================================= */
.tm-countdown { text-align: center; padding: 32px 20px; }
.tm-countdown-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-primary, #f1f5f9);
}
.tm-countdown-subtitle {
    font-size: 14px;
    color: var(--text-muted, #94a3b8);
    margin: 0 0 24px;
}
.tm-countdown-boxes {
    display: flex;
    gap: 16px;
    justify-content: center;
}
.tm-countdown-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}
.tm-countdown-cards .tm-countdown-box {
    background: var(--card-bg, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 12px;
    padding: 16px 20px;
}
.tm-countdown-value {
    font-size: 36px;
    font-weight: 800;
    color: #8b5cf6;
    line-height: 1;
}
.tm-countdown-label {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 6px;
}

/* =============================================
   ACCORDION
   ============================================= */
.tm-accordion { display: flex; flex-direction: column; gap: 8px; }
.tm-accordion-input { display: none; }
.tm-accordion-item {
    border: 1px solid var(--border-color, #334155);
    border-radius: 10px;
    overflow: hidden;
}
.tm-accordion-bordered .tm-accordion-item,
.tm-accordion-card .tm-accordion-item {
    background: var(--card-bg, #1e293b);
}
.tm-accordion-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
    transition: all 0.2s;
}
.tm-accordion-question:hover { color: #8b5cf6; }
.tm-accordion-icon { transition: transform 0.3s; flex-shrink: 0; }
.tm-accordion-input:checked + .tm-accordion-question .tm-accordion-icon { transform: rotate(180deg); }
.tm-accordion-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.tm-accordion-input:checked ~ .tm-accordion-answer { max-height: 500px; }
.tm-accordion-answer-inner {
    padding: 0 18px 16px;
    color: var(--text-muted, #94a3b8);
    line-height: 1.6;
}

/* =============================================
   TABS
   ============================================= */
.tm-tab-input { display: none; }
.tm-tabs-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color, #334155);
    overflow-x: auto;
}
.tm-tab-label {
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted, #94a3b8);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.2s;
}
.tm-tab-label:hover { color: var(--text-primary, #f1f5f9); }
.tm-tab-input:checked + .tm-tab-label { color: #8b5cf6; border-bottom-color: #8b5cf6; }
.tm-tab-panel { display: none; padding: 20px 0; }
.tm-tab-panel.active { display: block; }
.tm-tab-content { color: var(--text-primary, #f1f5f9); line-height: 1.7; }

/* =============================================
   CONTACT FORM
   ============================================= */
.tm-contact-form { max-width: 600px; }
.tm-contact-form-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--text-primary, #f1f5f9);
}
.tm-form { display: flex; flex-direction: column; gap: 16px; }
.tm-form-input {
    padding: 12px 16px;
    background: var(--input-bg, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 10px;
    color: var(--text-primary, #f1f5f9);
    font-size: 14px;
    transition: border-color 0.2s;
}
.tm-form-input:focus { border-color: #8b5cf6; outline: none; }
textarea.tm-form-input { min-height: 120px; resize: vertical; }
.tm-form-submit {
    padding: 12px 24px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    align-self: flex-start;
}
.tm-form-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* =============================================
   MAP
   ============================================= */
.tm-map {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color, #334155);
}
.tm-map iframe { display: block; }

/* =============================================
   SPACER & DIVIDER
   ============================================= */
.tm-spacer { height: var(--height, 40px); }
@media (max-width: 768px) { .tm-spacer { height: var(--mobile-height, var(--height, 40px)); } }
.tm-divider { width: var(--width, 100%); margin: 0 auto; }
.tm-divider hr {
    border: none;
    height: var(--thickness, 1px);
    background: var(--color, var(--border-color, #334155));
}
.tm-divider-dashed hr { background: none; border-top: var(--thickness, 1px) dashed var(--color, var(--border-color, #334155)); }
.tm-divider-dotted hr { background: none; border-top: var(--thickness, 1px) dotted var(--color, var(--border-color, #334155)); }
.tm-divider-gradient hr { background: linear-gradient(90deg, transparent, var(--color, #8b5cf6), transparent); }

/* =============================================
   SOCIAL LINKS
   ============================================= */
.tm-social-links { display: flex; gap: 12px; flex-wrap: wrap; }
.tm-social-links.tm-social-centered { justify-content: center; }
.tm-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--card-bg, #1e293b);
    border: 1px solid var(--border-color, #334155);
    color: var(--text-muted, #94a3b8);
    text-decoration: none;
    transition: all 0.2s;
}
.tm-social-link:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    transform: translateY(-2px);
}

/* =============================================
   EMPTY STATE
   ============================================= */
.tm-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    background: var(--card-bg, #1e293b);
    border: 2px dashed var(--border-color, #334155);
    border-radius: 12px;
    color: var(--text-muted, #94a3b8);
    font-size: 14px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .tm-countdown-boxes { gap: 8px; }
    .tm-countdown-value { font-size: 24px; }
    .tm-countdown-box { min-width: 60px; }
    .tm-gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .tm-gallery-masonry { columns: 2; }
}
