/* 
 * Data Gateway Test Suite - Styles
 * Platform UI Standards v2.3 Compliant
 */

.compact-console {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 280px 1fr;
    margin-top: 30px;
}

/* Sidebar for Operations */
.console-sidebar {
    background: rgba(102, 126, 234, 0.03);
    /* Light tint based on primary */
    border-right: 1px solid var(--border-color);
    padding: var(--space-4);
}

.console-menu-title {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
    font-weight: var(--font-weight-bold);
}

.ops-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ops-item {
    display: flex;
    align-items: center;
    padding: var(--space-3);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    border: 1px solid transparent;
}

.ops-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ops-item.active {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    border-color: rgba(102, 126, 234, 0.2);
}

.ops-icon {
    font-size: 1.2rem;
    margin-right: var(--space-3);
    width: 24px;
    text-align: center;
}

/* Main Content Area */
.console-main {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
}

.console-header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ops-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.ops-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Form Styles for Compactness */
.compact-form-group {
    margin-bottom: var(--space-4);
}

.compact-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.compact-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.compact-input:focus {
    outline: 2px solid var(--primary);
    border-color: transparent;
}

/* Results Area - Collapsible Details Element */
.console-output {
    background: #1e1e1e;
    /* Code editor fake bg */
    border-radius: var(--radius-md);
    border: 1px solid #333;
    padding: 0;
    overflow: hidden;
    margin-top: auto;
    transition: all 0.2s ease;
}

/* State: Details CLOSED - Collapse to header only (minified) */
.console-output:not([open]) {
    flex-grow: 0;
    min-height: auto;
    max-height: 45px;
    /* Just enough for header */
}

/* Hide the content when closed - aggressive approach */
.console-output:not([open]) .json-response {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

/* State: Details OPEN - Expand */
.console-output[open] {
    flex-grow: 1;
    min-height: 200px;
    max-height: none;
    display: flex;
    flex-direction: column;
}

.console-output[open] .json-response {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    visibility: visible !important;
}

/* Header styling - always visible */
.output-header {
    background: #2d2d2d;
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
    color: #aaa;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    min-height: 40px;
    flex-shrink: 0;
}

.output-header:hover {
    background: #3d3d3d;
}

.json-response {
    padding: var(--space-3);
    color: #d4d4d4;
    font-family: 'Fira Code', var(--font-mono);
    font-size: 13px;
    overflow: auto;
    max-height: 350px;
    white-space: pre-wrap;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .compact-console {
        grid-template-columns: 1fr;
    }

    .console-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        overflow-x: auto;
        padding: var(--space-2);
    }

    .ops-menu {
        display: flex;
        gap: var(--space-2);
    }

    .ops-item {
        margin: 0;
        white-space: nowrap;
    }
}

/* Modern Gradient Button override */
.btn-glow {
    box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.39);
}

/* Visual Card Styles - Modern Design (Inspired by KB News Dashboard) */
.visual-card {
    background: linear-gradient(135deg, var(--surface-1) 0%, rgba(102, 126, 234, 0.02) 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    height: 100%;
    padding: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
}

.visual-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.visual-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.visual-card:hover::before {
    transform: scaleX(1);
}

.visual-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.visual-card-header .visual-card-subtitle {
    display: none;
}

.visual-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    flex: 1;
    transition: color 0.2s ease;
}

.visual-card:hover .visual-card-title {
    color: var(--primary);
}

.visual-card-subtitle {
    font-size: 0.60rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(102, 126, 234, 0.3);
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.visual-card-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    flex: 1;
}

.visual-card-desc {
    height: auto;
    max-height: 70px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.visual-card-footer {
    padding: 0;
    background: transparent;
    border: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    flex-wrap: nowrap;
}

.visual-card-footer .visual-card-subtitle {
    display: block;
    order: 0;
    flex-basis: auto;
    margin-bottom: 0;
    width: auto;
    margin-right: auto;
}

.visual-card-footer a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    background: linear-gradient(135deg, var(--primary), rgba(102, 126, 234, 0.8));
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.visual-card-footer a:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.visual-card-footer button {
    padding: 0.45rem 0.7rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: var(--primary);
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    flex-shrink: 0;
}

.visual-card-footer button:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--primary);
}

.badge-new 
{
    position: relative;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 0.1rem 0.1rem;
    font-size: 0.5rem;
    border-radius: 6px;
    font-weight: 400;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(121, 142, 235, 0.2);
}

/* Info Card - Stile Standard Portale */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.info-card:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.08);
}

.info-card h6 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.info-card p {
    margin: 0;
    line-height: 1.5;
}

.info-card code {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Search Loader - Spinner Animation */
.search-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    margin-top: 2rem;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

.loader-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Visual Card Tags Container */
.visual-card-tags {

    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    min-height: auto;
}

/* Small Badge Variant */
.badge-sm {
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
    border-radius: 6px;
}

/* MinIO Files Table Styles */
.files-table {
    font-size: 0.85rem;
}

.files-table-name {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    word-break: break-all;
    color: var(--text-secondary);
}

.files-table-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    white-space: nowrap;
}

.files-table-actions .btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
}

/* MinIO Table Headers - Clickable for Sorting */
.files-table thead th {
    transition: all 0.2s ease;
    padding: 0.75rem;
}

.files-table thead th:hover:not(:last-child) {
    background: rgba(102, 126, 234, 0.08);
    color: var(--primary);
}

.files-table thead th:not(:last-child) {
    cursor: pointer;
    user-select: none;
}

/* Extension Filter Select */
#extension-filter {
    max-width: 300px;
    border-color: var(--border-color);
}

#extension-filter:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Snapshot Details & Job Tab - Full Width Cards */
#tab-snapshot-details .row {
    display: flex;
    flex-direction: column;
}

#tab-snapshot-details .visual-card {
    width: 100%;
    margin-bottom: 1rem;
}

#tab-snapshot-details .visual-card-desc {
    max-height: none;
    -webkit-line-clamp: unset;
    overflow: visible;
}

/* Hide Snapshot button in Catalog Search results */
#visual-results-search .visual-card-footer button:last-child {
    display: none;
}