/**
 * APEX K9 // Visual Breed Engine Core Stylesheet v2
 * Layout Architecture: Luxury Dark Aesthetic Hybrid Media-Grid Format
 */

:root {
    --bg-primary: #0a0c10;
    --bg-surface: #11141b;
    --bg-card: #171c26;
    --border-color: #242c3b;
    --border-focus: #d4af37;
    --text-high-contrast: #f5f7fa;
    --text-normal: #c5cbd3;
    --text-muted: #848e9c;
    --accent-gold: #d4af37;
    --accent-gold-hover: #bda032;
    --accent-crimson-alert: #ff4d4d;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-normal);
    font-family: var(--font-stack);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

.app-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.app-header h1 {
    color: var(--text-high-contrast);
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 8px 0;
}

.app-header h1 span {
    color: var(--accent-gold);
}

.app-header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

.control-dashboard {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.search-form-group {
    display: flex;
    gap: 16px;
    width: 100%;
}

.input-field-wrapper {
    flex-grow: 1;
    position: relative;
}

.input-field-wrapper input {
    width: 100%;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--text-high-contrast);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field-wrapper input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(214, 175, 55, 0.15);
}

.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(23, 28, 38, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    display: none;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: default;
    color: var(--text-normal);
    font-size: 0.95rem;
    transition: background-color 0.15s, color 0.15s;
}

.suggestion-item:hover, 
.suggestion-item.active-navigated {
    background-color: var(--accent-gold);
    color: #000000;
    font-weight: 500;
}

.action-trigger-button {
    background-color: var(--accent-gold);
    color: #000000;
    border: none;
    border-radius: 8px;
    padding: 0 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.action-trigger-button:hover {
    background-color: var(--accent-gold-hover);
}

.action-trigger-button:disabled {
    background-color: var(--bg-card);
    color: var(--text-muted);
    cursor: not-allowed;
    border: 1px solid var(--border-color);
}

#statusLoggingOverlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

#loaderAnimation {
    display: none;
    width: 44px;
    height: 44px;
    border: 3px solid rgba(214, 175, 55, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-gold);
    animation: spinSequence 0.8s linear infinite;
    margin-bottom: 20px;
}

@keyframes spinSequence { to { transform: rotate(360deg); } }

#mediaDisplayOutputCanvas {
    display: none;
    flex-direction: column;
    gap: 30px;
}

.canvas-identity-header {
    background-color: var(--bg-surface);
    border-left: 4px solid var(--accent-gold);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-gold);
    border-radius: 4px 12px 12px 4px;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.canvas-identity-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-high-contrast);
}

.media-viewport-frame {
    position: relative;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 10;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.media-viewport-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.media-viewport-frame img.asset-loaded {
    opacity: 1;
}

.skeleton-shimmer-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #11141b 25%, #1c212d 50%, #11141b 75%);
    background-size: 200% 100%;
    animation: placeholderShimmer 1.5s infinite linear;
}

@keyframes placeholderShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Integrated Fact Matrix Grid Architecture Container Layout */
.facts-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.fact-metric-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fact-metric-card.full-width-card {
    grid-column: 1 / -1;
}

.fact-metric-card .metric-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.fact-metric-card .metric-value {
    font-size: 1.1rem;
    color: var(--text-high-contrast);
    font-weight: 500;
    min-height: 1.65rem; /* Prevents card jumping during live asynchronous string injection mutations */
}

@media (max-width: 600px) {
    .search-form-group { flex-direction: column; }
    .action-trigger-button { width: 100%; padding: 14px; }
    .media-viewport-frame { aspect-ratio: 1 / 1; }
}

.app-like-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 12px;
    margin-top: 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.app-like-trigger:hover:not(:disabled) {
    color: var(--accent-crimson-alert);
    border-color: var(--accent-crimson-alert);
    background: var(--bg-surface);
    transform: scale(1.05);
}
.app-like-trigger.liked {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    background: var(--bg-surface);
    cursor: not-allowed;
}
.app-like-trigger:disabled:not(.liked) {
    opacity: 0.6;
    cursor: not-allowed;
}