/**
 * LPS Mircea Eliade - WebAssembly Components CSS
 * Stiluri pentru componentele cu funcționalități WebAssembly
 */

/* ========================================
   VARIABILE CSS
   ======================================== */

:root {
    --wasm-primary: #1e4d8c;
    --wasm-secondary: #2980b9;
    --wasm-accent: #e74c3c;
    --wasm-success: #27ae60;
    --wasm-warning: #f39c12;
    --wasm-danger: #e74c3c;
    --wasm-dark: #1a1a2e;
    --wasm-light: #f8f9fa;
    --wasm-border: #e0e0e0;
    --wasm-shadow: 0 4px 20px rgba(0,0,0,0.1);
    --wasm-radius: 12px;
    --wasm-transition: all 0.3s ease;
}

/* ========================================
   SEARCH COMPONENT
   ======================================== */

.wasm-search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.wasm-search-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    font-size: 16px;
    border: 2px solid var(--wasm-border);
    border-radius: var(--wasm-radius);
    background: white;
    transition: var(--wasm-transition);
    font-family: inherit;
}

.wasm-search-input:focus {
    outline: none;
    border-color: var(--wasm-primary);
    box-shadow: 0 0 0 4px rgba(30, 77, 140, 0.1);
}

.wasm-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #4a5568;
    font-size: 20px;
    pointer-events: none;
}

.wasm-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--wasm-radius);
    box-shadow: var(--wasm-shadow);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    border: 1px solid var(--wasm-border);
}

.wasm-search-results.active {
    display: block;
    animation: wasmSlideDown 0.2s ease;
}

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

.wasm-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    transition: var(--wasm-transition);
    border-bottom: 1px solid #f0f0f0;
}

.wasm-search-item:last-child {
    border-bottom: none;
}

.wasm-search-item:hover {
    background: #f5f8ff;
}

.wasm-search-item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wasm-search-item-name {
    font-weight: 600;
    color: var(--wasm-dark);
    font-size: 15px;
}

.wasm-search-item-meta {
    font-size: 13px;
    color: #666;
}

.wasm-search-item-score {
    background: var(--wasm-success);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.wasm-search-empty {
    padding: 30px;
    text-align: center;
    color: #4a5568;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.wasm-search-empty i {
    font-size: 32px;
    opacity: 0.5;
}

/* ========================================
   FORM VALIDATION
   ======================================== */

.wasm-valid {
    border-color: var(--wasm-success) !important;
    background: rgba(39, 174, 96, 0.05) !important;
}

.wasm-invalid {
    border-color: var(--wasm-danger) !important;
    background: rgba(231, 76, 60, 0.05) !important;
}

.wasm-field-error {
    color: var(--wasm-danger);
    font-size: 13px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: wasmShake 0.3s ease;
}

.wasm-field-error::before {
    content: "⚠";
}

@keyframes wasmShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.wasm-form-group {
    margin-bottom: 20px;
}

.wasm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--wasm-dark);
}

.wasm-form-group input,
.wasm-form-group textarea,
.wasm-form-group select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid var(--wasm-border);
    border-radius: 8px;
    transition: var(--wasm-transition);
    font-family: inherit;
}

.wasm-form-group input:focus,
.wasm-form-group textarea:focus,
.wasm-form-group select:focus {
    outline: none;
    border-color: var(--wasm-primary);
    box-shadow: 0 0 0 3px rgba(30, 77, 140, 0.1);
}

/* Input with icon */
.wasm-input-icon {
    position: relative;
}

.wasm-input-icon input {
    padding-left: 45px;
}

.wasm-input-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #4a5568;
    font-size: 18px;
}

.wasm-input-icon.wasm-valid i {
    color: var(--wasm-success);
}

.wasm-input-icon.wasm-invalid i {
    color: var(--wasm-danger);
}

/* ========================================
   ANIMATED COUNTERS
   ======================================== */

[data-wasm-counter] {
    font-variant-numeric: tabular-nums;
}

.wasm-stat-card {
    background: white;
    border-radius: var(--wasm-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--wasm-shadow);
    transition: var(--wasm-transition);
}

.wasm-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.wasm-stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--wasm-primary) 0%, var(--wasm-secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.wasm-stat-icon i {
    color: white;
    font-size: 28px;
}

.wasm-stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--wasm-primary);
    line-height: 1;
    margin-bottom: 8px;
}

.wasm-stat-label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Gold, Silver, Bronze variants */
.wasm-stat-card.gold .wasm-stat-icon {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
}

.wasm-stat-card.silver .wasm-stat-icon {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
}

.wasm-stat-card.bronze .wasm-stat-icon {
    background: linear-gradient(135deg, #cd7f32 0%, #a0522d 100%);
}

/* ========================================
   LOADING STATES
   ======================================== */

.wasm-loading {
    position: relative;
    pointer-events: none;
}

.wasm-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--wasm-border);
    border-top-color: var(--wasm-primary);
    border-radius: 50%;
    animation: wasmSpin 0.8s linear infinite;
}

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

/* ========================================
   BADGE & INDICATORS
   ======================================== */

.wasm-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(30, 77, 140, 0.1);
    color: var(--wasm-primary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.wasm-badge i {
    font-size: 14px;
}

.wasm-badge.wasm-badge-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--wasm-success);
}

.wasm-badge.wasm-badge-warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--wasm-warning);
}

.wasm-badge.wasm-badge-danger {
    background: rgba(231, 76, 60, 0.1);
    color: var(--wasm-danger);
}

/* ========================================
   TOOLTIPS
   ======================================== */

.wasm-tooltip {
    position: relative;
    cursor: help;
}

.wasm-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--wasm-dark);
    color: white;
    font-size: 13px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--wasm-transition);
    z-index: 1000;
}

.wasm-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 6px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--wasm-dark);
    opacity: 0;
    visibility: hidden;
    transition: var(--wasm-transition);
}

.wasm-tooltip:hover::after,
.wasm-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .wasm-search-container {
        max-width: 100%;
    }
    
    .wasm-stat-number {
        font-size: 2rem;
    }
    
    .wasm-stat-card {
        padding: 20px;
    }
}

/* ========================================
   DARK MODE
   ======================================== */




