/**
 * GriffinForms Theme Selection Modal Styles
 */

/* Modal layout helpers */

#griffinforms-builder-modal-formthemes .griffinforms-formthemes-tab-content {
    height: 600px;
}

#griffinforms-builder-modal-formthemes .griffinforms-formthemes-pane {
    height: 100%;
}

#griffinforms-builder-modal-formthemes .griffinforms-formthemes-layout {
    height: 100%;
    flex-wrap: nowrap;
    align-items: stretch;
}

#griffinforms-builder-modal-formthemes .griffinforms-formthemes-sidebar {
    flex: 0 0 180px;
    max-width: 180px;
    min-width: 180px;
}

#griffinforms-builder-modal-formthemes .griffinforms-formthemes-content {
    flex: 1 1 auto;
    min-width: 0;
}

/* Category navigation — mirrors FormOptions tab button style */
#griffinforms-builder-modal-formthemes .griffinforms-theme-categories {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    border-radius: 6px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    color: var(--gf-color-text, #333);
    text-align: left;
    cursor: pointer;
    transition: color 160ms ease;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-category-btn:hover {
    color: var(--gf-color-primary, #6f2cf2);
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-category-btn.active {
    color: var(--gf-color-primary, #6f2cf2);
    background-color: color-mix(in srgb, var(--gf-color-primary, #6f2cf2) 10%, transparent);
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-category-label {
    flex: 1;
    min-width: 0;
    text-align: left;
    text-transform: capitalize;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-category-count {
    flex-shrink: 0;
    min-width: 20px;
    padding: 1px 6px;
    background-color: color-mix(in srgb, var(--gf-color-primary, #6f2cf2) 10%, transparent);
    color: var(--gf-color-primary, #6f2cf2);
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    text-align: center;
    transition: background-color 160ms ease, color 160ms ease;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-category-btn.active .griffinforms-theme-category-count {
    background-color: var(--gf-color-primary, #6f2cf2);
    color: #ffffff;
}

/* Theme grid layout */
#griffinforms-builder-modal-formthemes .griffinforms-theme-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap:  36px 24px;
    padding: 8px 4px;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-tile {
    border: none;
    padding: 0;
    transition: none;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-tile:hover .griffinforms-swatch-preview {
    transform: scale(0.85);
    animation: griffinforms-theme-tilt-y 2s ease-in-out 0.4s infinite;
}



#griffinforms-builder-modal-formthemes .griffinforms-theme-tile-swatch {
    display: flex;
    align-items: flex-end;
    justify-content: stretch;
    border-radius: 8px;
}

#griffinforms-builder-modal-formthemes .griffinforms-swatch-preview {
    width: 100%;
    min-height: 280px;
    max-height: 400px;
    overflow: hidden;
    transform: scale(0.8);
    transform-origin: center;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-swatch-container {
    width: 100%;
    transform-origin: center;
    transform-style: preserve-3d;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-swatch-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    font-size: 13px;
    line-height: 1.5;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-swatch-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: none !important;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-swatch-heading {
    margin-bottom: 0;
    font-weight: 600;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-swatch-default {
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 1px dashed rgba(31, 41, 51, 0.2);
    background-color: #f8f9fa;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-swatch-description {
    color: #6c737f;
    font-size: 12px;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-swatch-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-swatch-label {
    margin-bottom: 0;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-swatch-field-description {
    margin-top: 0;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-swatch-input {
    font-family: inherit;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-swatch-button {
    font-family: inherit;
    letter-spacing: 0.01em;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: default !important;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-swatch-button-wrap {
    display: flex;
    justify-content: center;
}

@keyframes griffinforms-theme-tilt-y {
    0% {
        transform: scale(0.85) perspective(800px) rotateY(-4deg);
    }
    50% {
        transform: scale(0.85) perspective(800px) rotateY(4deg);
    }
    100% {
        transform: scale(0.85) perspective(800px) rotateY(-4deg);
    }
}

/* Tile meta */
#griffinforms-builder-modal-formthemes .griffinforms-theme-name {
    font-size: 15px;
    color: #1f2933;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-description {
    min-height: 36px;
    line-height: 1.5;
    max-height: 4.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Loading skeletons */
#griffinforms-builder-modal-formthemes .griffinforms-theme-placeholder {
    border-radius: 12px;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-placeholder-swatch {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #f7f8fb;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-placeholder .placeholder {
    display: block;
    border-radius: 10px;
    background-color: #ebeef3;
    opacity: 1;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-placeholder-block {
    border-radius: 12px;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-placeholder-origin {
    width: 52px;
    height: 10px;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-placeholder-title {
    width: 72%;
    height: 16px;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-placeholder-text {
    width: 94%;
    height: 12px;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-placeholder-text-short {
    width: 68%;
    height: 12px;
}

#griffinforms-builder-modal-formthemes .griffinforms-theme-placeholder-btn {
    height: 36px;
    border-radius: 999px;
}

/* Modal layout adjustments */

#griffinforms-formthemes-categories-container,
#griffinforms-formthemes-content-container {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
}

/* Responsive */
@media (max-width: 1024px) {
    #griffinforms-builder-modal-formthemes .griffinforms-theme-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    #griffinforms-builder-modal-formthemes .griffinforms-formthemes-layout {
        flex-direction: column;
    }

    #griffinforms-builder-modal-formthemes .griffinforms-formthemes-sidebar {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #dee2e6;
        margin-bottom: 16px;
    }

    #griffinforms-builder-modal-formthemes .griffinforms-theme-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    #griffinforms-builder-modal-formthemes .griffinforms-theme-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}
