/**
 * SmartDect.ro - UI Components
 * Reusable component styles for modern interface
 * 
 * @version 2.0.0
 * @requires design-system.css
 */

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    line-height: 1;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Primary */
.btn-primary {
    background-color: var(--primary);
    color: var(--text-dark);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow-sm);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* Button Secondary */
.btn-secondary {
    background-color: var(--surface-dark);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--border-dark);
    border-color: var(--primary-border);
}

/* Button Outline */
.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--primary-light);
    border-color: var(--primary-border);
    color: var(--primary);
}

/* Button Ghost */
.btn-ghost {
    background-color: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

.btn-icon {
    padding: var(--space-3);
    aspect-ratio: 1;
}

/* ============================================
   CARDS & PANELS (FIXED)
   ============================================ */

.card {
    background: var(--surface-dark);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: var(--transition-smooth);
    position: relative;
}

.card-glass {
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.card-header {
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-lighter);
    margin-bottom: var(--space-4);
}

.card-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: var(--space-1);
}

/* ============================================
   STATS CARD
   ============================================ */

.stat-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    border-color: var(--primary-border);
    box-shadow: var(--shadow-lg);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: var(--text-2xl);
}

.stat-value {
    font-size: var(--text-4xl);
    font-weight: var(--font-black);
    color: var(--text-primary);
    line-height: var(--leading-tight);
}

.stat-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.stat-badge-success {
    background: var(--success-light);
    color: var(--success);
}

.stat-badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-badge-info {
    background: var(--info-light);
    color: var(--info);
}

/* ============================================
   BADGES & TAGS
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-error {
    background: var(--error-light);
    color: var(--error);
}

.badge-neutral {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* ============================================
   FORM INPUTS
   ============================================ */

.input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    font-family: var(--font-display);
    color: var(--text-primary);
    background-color: var(--surface-dark);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    outline: none;
    transition: var(--transition-base);
}

.input::placeholder {
    color: var(--text-subtle);
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-4);
    color: var(--text-subtle);
    pointer-events: none;
}

.input-group .input {
    padding-left: var(--space-12);
}

/* ============================================
   AVATARS
   ============================================ */

.avatar {
    border-radius: var(--radius-full);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    background: var(--surface-dark);
    border: 2px solid var(--border-light);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: var(--text-xs);
}

.avatar-md {
    width: 40px;
    height: 40px;
    font-size: var(--text-sm);
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: var(--text-md);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Avatar with ring */
.avatar-ring {
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* ============================================
   TABLES
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--surface-dark);
    border-bottom: 1px solid var(--border-dark);
}

.table th {
    padding: var(--space-4) var(--space-6);
    text-align: left;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.table td {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-lighter);
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* ============================================
   ACTIVITY ITEM
   ============================================ */

.activity-item {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.activity-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.activity-desc {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.activity-badges {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.activity-time {
    font-size: var(--text-xs);
    color: var(--text-subtle);
    flex-shrink: 0;
}

/* ============================================
   DIVIDERS
   ============================================ */

.divider {
    height: 1px;
    background: var(--border-lighter);
    margin: var(--space-6) 0;
}

.divider-vertical {
    width: 1px;
    height: 100%;
    background: var(--border-lighter);
    margin: 0 var(--space-4);
}

/* ============================================
   LOADING STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg,
            var(--surface-dark) 0%,
            var(--border-dark) 50%,
            var(--surface-dark) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spinner-spin 0.8s linear infinite;
}

@keyframes spinner-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   TOOLTIPS
   ============================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: var(--space-2) var(--space-3);
    background: var(--text-dark);
    color: var(--text-primary);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-base);
    z-index: var(--z-tooltip);
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}
/* ============================================
   COOKIE CONSENT BANNER
   ============================================ */

.cookie-banner {
    position: fixed;
    bottom: var(--space-6);
    left: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-fixed);
    display: none; /* Controlled by JS */
    animation: slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
    .cookie-banner {
        left: auto;
        max-width: 400px;
    }
}

.cookie-content {
    background: var(--glass-bg-dark);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.cookie-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.cookie-icon {
    color: var(--primary);
    font-size: 24px;
}

.cookie-title {
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
    color: var(--text-primary);
}

.cookie-text {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: var(--space-5);
}

.cookie-text a {
    color: var(--primary);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: var(--space-3);
}

@keyframes slide-up {
    from {
        transform: translateY(100%) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}
