/**
 * Search Product Styling
 * Glass morphism design with gradient accents
 */

/* Search Product Container */
.search-product-container {
    min-height: 100vh;
    padding: 2rem 0;
}

/* Stat Display Components */
.stat-display {
    text-align: center;
    padding: 1rem;
}

.stat-display-group {
    display: flex;
    gap: 3rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.stat-display-row {
    display: flex;
    justify-content: space-around;
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary, #8b5cf6));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.empty-state-icon {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.error-state-icon {
    color: var(--color-danger, #ef4444);
    margin-bottom: 2rem;
}

.error-state h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.error-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Instance Card */
.instance-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.instance-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.instance-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.instance-card h3 {
    font-size: 1.25rem;
    margin: 0;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.status-inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-badge.status-warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
    display: inline-flex;
    align-items: center;
}

.status-badge.status-success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.status-secondary {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.card-actions .btn {
    flex: 1;
}

/* Search Header Component */
.search-header {
    background: linear-gradient(135deg, var(--gradient-start, #667eea), var(--gradient-end, #764ba2));
    padding: 4rem 2rem;
    border-radius: 24px;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.search-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
}

.search-header .display-title {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

/* Instance Grid */
.instances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Dashboard Styles */
.dashboard-container {
    min-height: 80vh;
    padding: 2rem 0;
}

/* Tab Navigation */
.nav-tabs-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: -2rem -2rem 2rem -2rem;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-tabs {
    display: flex;
    gap: 2rem;
    padding: 0 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs::-webkit-scrollbar {
    height: 2px;
}

.nav-tabs::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.nav-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.nav-tabs a {
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
}

.nav-tabs a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tabs a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: rgba(59, 73, 137, 0.1);
}

/* Tab Content */
.tab-content {
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Charts Container */
.chart-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    height: 400px;
}

.chart-container canvas {
    max-height: 100%;
}

/* Data Tables */
.data-table {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    margin: 2rem 0;
}

.data-table thead {
    background: rgba(255, 255, 255, 0.05);
}

.data-table th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table td {
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Configuration Form */
.config-form {
    max-width: 600px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 73, 137, 0.1);
    background: rgba(255, 255, 255, 0.15);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.help-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Code Snippets */
.code-snippet {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.code-snippet code {
    color: #a5f3fc;
    line-height: 1.6;
}

/* Loading States */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.spinner {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

/* Progress Stepper */
.progress-stepper {
    display: flex;
    justify-content: space-between;
    margin: 3rem 0;
    position: relative;
}

.progress-stepper::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    z-index: -1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.step.active .step-circle {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(59, 73, 137, 0.5);
}

.step.completed .step-circle {
    background: var(--color-success, #22c55e);
    color: white;
    border-color: var(--color-success, #22c55e);
}

.step-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Buttons display inline naturally with their own spacing */

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

    .stat-display-group {
        gap: 1.5rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .search-header .display-title {
        font-size: 2rem;
    }

    .nav-tabs {
        gap: 1rem;
        padding: 0 1rem;
    }

    .nav-tabs a {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 1rem;
    }

    .chart-container {
        height: 300px;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .search-product-container {
        padding: 1rem 0;
    }

    .stat-display-row {
        flex-direction: column;
        gap: 1rem;
    }

    .card-actions {
        flex-direction: column;
    }

    /* Buttons handled by button-mobile-full class */

    .progress-stepper {
        margin: 2rem 0;
    }

    .step-label {
        font-size: 0.8rem;
    }
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
    .instance-card {
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .data-table {
        background: rgba(0, 0, 0, 0.3);
    }

    .form-control {
        background: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .code-snippet {
        background: rgba(0, 0, 0, 0.5);
    }
}

/* Print Styles */
@media print {
    .nav-tabs-container,
    .card-actions {
        display: none;
    }

    .instance-card {
        break-inside: avoid;
    }

    .data-table {
        background: white;
        border: 1px solid #ddd;
    }

    .data-table th,
    .data-table td {
        border-color: #ddd;
    }
}