/* ===================================
   TABLEPRESSO CARDS - Frontend CSS
   =================================== */

/* Preview Card (legacy shortcode) */
.tablepresso-preview-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 20px 0;
    overflow: hidden;
    transition: box-shadow 0.3s ease-in-out;
}
.tablepresso-preview-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
.tablepresso-preview-card .card-header {
    background-color: #f7f7f7;
    border-bottom: 1px solid #e0e0e0;
    padding: 16px;
}
.tablepresso-preview-card .card-title {
    font-size: 1.25em;
    font-weight: 600;
    margin: 0;
}
.tablepresso-preview-card .card-body {
    padding: 16px;
}
.tablepresso-preview-card .card-description {
    color: #555;
    font-size: 1em;
    margin: 0;
}
.tablepresso-preview-card .card-footer {
    background-color: #f7f7f7;
    border-top: 1px solid #e0e0e0;
    padding: 12px 16px;
    text-align: right;
}
.tablepresso-preview-card .load-table-data {
    background-color: #0073aa;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    padding: 10px 16px;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
}
.tablepresso-preview-card .load-table-data:hover {
    background-color: #005a87;
}


/* ===================================
   CARDS GRID
   =================================== */
.tablepresso-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Card base */
.tablepresso-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 18px;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    word-break: break-word;
}
.tablepresso-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Modern layout */
.tablepresso-card.modern {
    border-left: 5px solid #0073aa;
    background: linear-gradient(135deg, #f8fbff 0%, #eef5fb 100%);
    box-shadow: 0 4px 14px rgba(0, 115, 170, 0.08);
}
.tablepresso-card.modern:hover {
    box-shadow: 0 8px 24px rgba(0, 115, 170, 0.14);
}

/* Compact layout */
.tablepresso-card.compact {
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.92em;
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fafafa;
}

/* Card fields */
.tablepresso-card .card-field {
    margin-bottom: 8px;
    line-height: 1.5;
}
.tablepresso-card .card-field:last-child {
    margin-bottom: 0;
}
.tablepresso-card .card-field-label {
    font-weight: 600;
    color: #222;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.3px;
}
.tablepresso-card .card-field-value {
    color: #444;
}

/* Links inside cards */
.tablepresso-card .card-field-value a {
    color: #0073aa;
    text-decoration: none;
    word-break: break-all;
    transition: color 0.2s;
}
.tablepresso-card .card-field-value a:hover {
    color: #005a87;
    text-decoration: underline;
}


/* ===================================
   FLOATING SEARCH UI
   =================================== */
.stcp-search-wrapper {
    position: fixed;
    visibility: hidden;
    z-index: 99998;
    display: flex;
    align-items: center;
    touch-action: none;   /* enables custom touch drag */
    user-select: none;
}

/* The circular FAB */
.stcp-search-fab {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0, 115, 170, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 2;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    flex-shrink: 0;
}
.stcp-search-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.45);
}
.stcp-search-wrapper.dragging .stcp-search-fab {
    cursor: grabbing;
    transform: scale(1.15);
    box-shadow: 0 8px 24px rgba(0, 115, 170, 0.5);
}
.stcp-search-fab svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
}

/* Expanded search bar */
.stcp-search-container {
    display: flex;
    align-items: center;
    height: 48px;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease 0.1s;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    margin-left: -26px;
    padding-left: 36px;
    z-index: 1;
    border: 1px solid #e0e0e0;
}
.stcp-search-wrapper.active .stcp-search-container {
    width: 260px;
    opacity: 1;
    padding-right: 8px;
}
.stcp-search-container input[type="text"] {
    flex-grow: 1;
    height: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1em;
    color: #333;
    padding: 0 8px;
}
.stcp-search-container input[type="text"]::placeholder {
    color: #999;
}

/* Close button */
.stcp-search-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 1.6em;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}
.stcp-search-close:hover {
    color: #333;
}

/* No results message */
.stcp-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 1.1em;
}


/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
    .tablepresso-cards-wrapper {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }
    .stcp-search-wrapper.active .stcp-search-container {
        width: 200px;
    }
    .stcp-search-fab {
        width: 46px;
        height: 46px;
    }
    .stcp-search-fab svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .tablepresso-card {
        padding: 14px;
    }
    .stcp-search-wrapper.active .stcp-search-container {
        width: 170px;
    }
}
