/* 
 * Shared Component Styles
 * Common styles used across multiple components
 * Version: 1.0
 */

/* ===== Glass-morphism Effects ===== */
.glass-container {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-dark .glass-container {
    background: rgba(33, 33, 33, 0.8);
    border: 1px solid rgba(232, 232, 240, 0.1);
}

.theme-light .glass-container {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.glass-container:hover {
    transform: translateY(-4px);
}

.theme-dark .glass-container:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.theme-light .glass-container:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

/* ===== Content Cards ===== */
.content-card {
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 32px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-dark .content-card {
    background: linear-gradient(135deg, rgba(33, 33, 33, 0.9) 0%, rgba(33, 33, 33, 0.8) 100%);
    border: 1px solid rgba(232, 232, 240, 0.1);
}

.theme-light .content-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.8) 100%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.content-card:hover {
    transform: translateY(-4px);
}

.theme-dark .content-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    border-color: rgba(232, 232, 240, 0.2);
}

.theme-light .content-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.15);
}

.content-card .card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
}

.theme-dark .content-card .card-header {
    border-bottom: 1px solid rgba(232, 232, 240, 0.1);
}

.theme-light .content-card .card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.content-card .card-title {
    font-weight: 600;
}

.theme-dark .content-card .card-title {
    color: rgba(232, 232, 240, 0.9);
}

.theme-light .content-card .card-title {
    color: rgba(0, 0, 0, 0.8);
}

/* ===== Modern Input Styles ===== */
.modern-input {
    border-radius: 12px !important;
    transition: all 0.3s ease;
}

.modern-input:focus-within {
    box-shadow: 0 0 0 3px rgba(0, 150, 255, 0.3) !important;
}

/* ===== Icon Button Enhanced ===== */
.icon-button-enhanced {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
}

.icon-button-enhanced:hover {
    background-color: rgba(0, 150, 255, 0.15);
    transform: scale(1.1);
}

.icon-button-enhanced:active {
    transform: scale(0.95);
}

/* ===== Filter Chips ===== */
.filter-chip {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px !important;
    font-weight: 600 !important;
    cursor: pointer;
}

.filter-chip:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.filter-chip:active {
    transform: translateY(0) scale(0.98);
}

/* ===== Tag Chips ===== */
.tag-chip {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px !important;
    font-weight: 600 !important;
    cursor: pointer;
}

.tag-chip:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ===== Data Cards ===== */
.data-card {
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.theme-dark .data-card {
    border: 1px solid rgba(232, 232, 240, 0.1);
    background: linear-gradient(135deg, rgba(33, 33, 33, 0.9) 0%, rgba(33, 33, 33, 0.8) 100%);
}

.theme-light .data-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.8) 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.data-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 150, 255, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.data-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.theme-dark .data-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(0, 150, 255, 0.5) !important;
    border-color: rgba(0, 150, 255, 0.5);
}

.theme-light .data-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(0, 150, 255, 0.3) !important;
    border-color: rgba(0, 150, 255, 0.5);
}

.data-card:hover::before {
    opacity: 1;
}

.data-card:active {
    transform: translateY(-4px) scale(1.01);
}

.data-card-icon {
    transition: transform 0.3s ease;
}

.data-card:hover .data-card-icon {
    transform: scale(1.1) rotate(5deg);
}

/* ===== Search Container ===== */
.search-container {
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 32px;
}

.theme-dark .search-container {
    background: rgba(33, 33, 33, 0.8);
    border: 1px solid rgba(232, 232, 240, 0.1);
}

.theme-light .search-container {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.search-input {
    border-radius: 14px !important;
    transition: all 0.3s ease;
}

.search-input:focus-within {
    box-shadow: 0 0 0 3px rgba(0, 150, 255, 0.3) !important;
}

/* ===== FAB Button ===== */
.fab-button {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 1000;
    width: 64px !important;
    height: 64px !important;
    box-shadow: 0 8px 24px rgba(0, 150, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-button:hover {
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 12px 40px rgba(0, 150, 255, 0.7);
}

.fab-button:active {
    transform: scale(1.05) rotate(90deg);
}

.creation-menu {
    position: fixed;
    bottom: 110px;
    right: 32px;
    z-index: 1001;
    min-width: 200px;
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Loading Shimmer ===== */
.loading-shimmer-wrapper {
    position: relative;
    overflow: hidden;
}

.loading-shimmer-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s infinite;
}

/* ===== Gradient Text ===== */
.gradient-text-primary {
    background: linear-gradient(135deg, #0096FF 0%, #38B6FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-success {
    background: linear-gradient(135deg, #00E057 0%, #00B845 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-warning {
    background: linear-gradient(135deg, #FF8B00 0%, #FF6B00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

/* ===== Collapsible Glass Panel ===== */
.glass-panel {
    position: absolute;
    z-index: 100;
    background-color: color-mix(in srgb, var(--mud-palette-surface), transparent 10%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.theme-dark .glass-panel {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-light .glass-panel {
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.glass-panel.collapsed {
    height: auto;
    width: auto !important; /* Allow width to shrink if needed, or keep fixed */
}

.glass-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
}

.theme-dark .glass-panel-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.theme-light .glass-panel-header {
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.theme-dark .glass-panel-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-light .glass-panel-header:hover {
    background: rgba(0, 0, 0, 0.06);
}

.glass-panel-content {
    padding: 12px;
    overflow-y: auto;
    max-height: 70vh;
}

/* ===== Stat Card Variants ===== */
.stat-card-success {
    border-top: 3px solid var(--mud-palette-success);
}

.stat-card-primary {
    border-top: 3px solid var(--mud-palette-primary);
}

.stat-card-warning {
    border-top: 3px solid var(--mud-palette-warning);
}

/* ===== Bento Icon Variants ===== */
.bento-icon-success {
    background: linear-gradient(135deg, rgba(var(--mud-palette-success-rgb, 0, 224, 87), 0.2) 0%, rgba(var(--mud-palette-success-rgb, 0, 224, 87), 0.05) 100%);
}

.bento-icon-primary {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb, 0, 150, 255), 0.2) 0%, rgba(var(--mud-palette-primary-rgb, 0, 150, 255), 0.05) 100%);
}

.bento-icon-warning {
    background: linear-gradient(135deg, rgba(var(--mud-palette-warning-rgb, 255, 139, 0), 0.2) 0%, rgba(var(--mud-palette-warning-rgb, 255, 139, 0), 0.05) 100%);
}

/* ===== Entity Card Accent ===== */
.entity-card-datablob-accent {
    border-left: 3px solid var(--mud-palette-warning);
}

/* ===== Opacity Utilities ===== */
.opacity-30 {
    opacity: 0.3;
}

/* ===== Hero Stat Card Accent Variants ===== */
.hero-stat-card.accent-info,
.accent-info {
    --accent-color: var(--mud-palette-info);
}

.hero-stat-card.accent-primary,
.accent-primary {
    --accent-color: var(--mud-palette-primary);
}

.hero-stat-card.accent-success,
.accent-success {
    --accent-color: var(--mud-palette-success);
}

.hero-stat-card.accent-warning,
.accent-warning {
    --accent-color: var(--mud-palette-warning);
}

.hero-stat-card.accent-error,
.accent-error {
    --accent-color: var(--mud-palette-error);
}

.hero-stat-card.accent-secondary,
.accent-secondary {
    --accent-color: var(--mud-palette-secondary, #9C27B0);
}

/* ===== Icon Label Colors ===== */
.icon-label-success {
    color: var(--mud-palette-success);
}

.icon-label-primary {
    color: var(--mud-palette-primary);
}

.icon-label-warning {
    color: var(--mud-palette-warning);
}

/* ===== Glass Panel Variants ===== */
.glass-panel-primary {
    background: color-mix(in srgb, var(--mud-palette-primary) 5%, transparent);
    border-color: color-mix(in srgb, var(--mud-palette-primary) 20%, transparent);
}

.glass-panel-success {
    background: color-mix(in srgb, var(--mud-palette-success) 5%, transparent);
    border-color: color-mix(in srgb, var(--mud-palette-success) 20%, transparent);
}

.glass-panel-warning {
    background: color-mix(in srgb, var(--mud-palette-warning) 5%, transparent);
    border-color: color-mix(in srgb, var(--mud-palette-warning) 20%, transparent);
}

/* ===== Preview Icon Wrapper ===== */
.preview-icon-wrapper {
    background: var(--mud-palette-action-default-hover);
}

/* ===== Creation Menu Backdrop ===== */
.creation-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 998;
    backdrop-filter: blur(2px);
    background-color: rgba(0, 0, 0, 0.3);
}

/* ===== Logo Preview Circle ===== */
.logo-preview-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: white;
}

.theme-dark .logo-preview-circle {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-light .logo-preview-circle {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.logo-preview-circle-lg {
    width: 48px;
    height: 48px;
}

/* ===== Responsive Utilities ===== */
@media (max-width: 960px) {
    .content-card {
        padding: 24px;
    }
    
    .search-container {
        padding: 20px;
    }
    
    .fab-button {
        width: 56px !important;
        height: 56px !important;
        bottom: 24px;
        right: 24px;
    }
}

@media (max-width: 600px) {
    .content-card {
        padding: 16px;
    }

    .glass-container {
        border-radius: 16px;
    }

    .data-card {
        border-radius: 12px;
    }
}

/* ===== DataPoint Card Theme Support ===== */
/* These styles must be global to respond to .theme-dark/.theme-light on ancestor elements */

.theme-dark .datapoint-card {
    background: linear-gradient(135deg, rgba(33, 33, 33, 0.95) 0%, rgba(24, 24, 24, 0.9) 100%);
    border: 1px solid rgba(232, 232, 240, 0.08);
}

.theme-light .datapoint-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.9) 100%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.theme-light .datapoint-card:hover {
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px color-mix(in srgb, var(--mud-palette-primary) 30%, transparent),
        0 0 40px color-mix(in srgb, var(--mud-palette-primary) 10%, transparent);
}

/* Card Background Overlay */
.theme-dark .card-bg-overlay {
    background: linear-gradient(
        180deg,
        rgba(18, 18, 18, 0.4) 0%,
        rgba(18, 18, 18, 0.7) 50%,
        rgba(18, 18, 18, 0.95) 100%
    );
}

.theme-light .card-bg-overlay {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.9) 100%
    );
}

.theme-dark .datapoint-card:hover .card-bg-overlay {
    background: linear-gradient(
        180deg,
        rgba(18, 18, 18, 0.3) 0%,
        rgba(18, 18, 18, 0.6) 50%,
        rgba(18, 18, 18, 0.9) 100%
    );
}

.theme-light .datapoint-card:hover .card-bg-overlay {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.85) 100%
    );
}

/* Validation Badge */
.theme-dark .validation-badge.pending {
    background: rgba(232, 232, 240, 0.08);
    color: rgba(232, 232, 240, 0.4);
}

.theme-light .validation-badge.pending {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.3);
}

/* Card Title */
.theme-dark .datapoint-card .card-title {
    color: rgba(232, 232, 240, 0.95);
}

.theme-light .datapoint-card .card-title {
    color: rgba(0, 0, 0, 0.85);
}

.theme-dark .datapoint-card:hover .card-title {
    color: white;
}

.theme-light .datapoint-card:hover .card-title {
    color: rgba(0, 0, 0, 0.95);
}

/* Card Subtitle */
.theme-dark .datapoint-card .card-subtitle {
    color: rgba(232, 232, 240, 0.5);
}

.theme-light .datapoint-card .card-subtitle {
    color: rgba(0, 0, 0, 0.5);
}

/* Card Footer */
.theme-dark .datapoint-card .card-footer {
    border-top: 1px solid rgba(232, 232, 240, 0.06);
}

.theme-light .datapoint-card .card-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Tags More */
.theme-dark .datapoint-card .tags-more {
    color: rgba(232, 232, 240, 0.4);
}

.theme-light .datapoint-card .tags-more {
    color: rgba(0, 0, 0, 0.4);
}

/* Meta Items */
.theme-dark .datapoint-card .meta-item {
    color: rgba(232, 232, 240, 0.35);
}

.theme-light .datapoint-card .meta-item {
    color: rgba(0, 0, 0, 0.35);
}

.theme-dark .datapoint-card:hover .meta-item {
    color: rgba(232, 232, 240, 0.5);
}

.theme-light .datapoint-card:hover .meta-item {
    color: rgba(0, 0, 0, 0.5);
}

/* Hover Reveal Panel */
.theme-dark .datapoint-card .hover-reveal {
    background: linear-gradient(0deg, rgba(18, 18, 18, 0.98) 0%, transparent 100%);
}

.theme-light .datapoint-card .hover-reveal {
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.98) 0%, transparent 100%);
}

/* Hover Meta Items */
.theme-dark .datapoint-card .hover-meta-item {
    color: rgba(232, 232, 240, 0.6);
}

.theme-light .datapoint-card .hover-meta-item {
    color: rgba(0, 0, 0, 0.6);
}

/* ===== Config Card Theme Support (AIConfigurationPanel) ===== */
.theme-dark .config-card {
    border: 1px solid rgba(232, 232, 240, 0.1);
    background: linear-gradient(135deg, rgba(33, 33, 33, 0.9) 0%, rgba(33, 33, 33, 0.8) 100%);
}

.theme-light .config-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.9) 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.theme-dark .config-card-header {
    border-bottom: 1px solid rgba(232, 232, 240, 0.1);
}

.theme-light .config-card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.theme-dark .threshold-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(232, 232, 240, 0.05);
}

.theme-light .threshold-container {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.theme-dark .config-card-actions {
    border-top: 1px solid rgba(232, 232, 240, 0.1);
}

.theme-light .config-card-actions {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}
