/**
 * HIPAA Auditors - Components V2
 * Modern, enterprise-grade component library
 * 
 * Components:
 * - Buttons (primary, secondary, outline, ghost)
 * - Cards (standard, elevated, featured)
 * - Badges and Tags
 * - Navigation
 * - Forms
 */

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-none);
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-all);
    white-space: nowrap;
    user-select: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 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-xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-xl);
}

/* Primary Button - Gradient with Glow */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-500) 0%, var(--accent-600) 100%);
    color: var(--white);
    border-color: transparent;
    box-shadow: var(--shadow-md), 0 0 0 rgba(6, 182, 212, 0);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-600) 0%, var(--accent-700) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--glow-accent);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

/* Secondary Button - Dark Gradient */
.btn-secondary {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    color: var(--white);
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--glow-primary);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--primary-700);
    border-color: var(--primary-600);
}

.btn-outline:hover {
    background: var(--primary-600);
    color: var(--white);
    border-color: var(--primary-600);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline:active {
    transform: translateY(0);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--primary-700);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--primary-50);
    color: var(--primary-800);
}

/* Button with Icon */
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.btn-icon svg,
.btn-icon i {
    width: 1.25em;
    height: 1.25em;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: var(--white);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: var(--transition-all);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* Card Variants */
.card-elevated {
    border: none;
    box-shadow: var(--shadow-md);
}

.card-elevated:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-featured {
    position: relative;
    border: 2px solid transparent;
    background: linear-gradient(var(--white), var(--white)) padding-box,
        linear-gradient(135deg, var(--accent-400), var(--primary-600)) border-box;
    box-shadow: var(--shadow-lg);
}

.card-featured:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-2xl);
}

.card-gradient {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--accent-50) 100%);
    border: none;
}

/* Card with Glassmorphism */
.card-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-lg);
}

/* Card Header */
.card-header {
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border-primary);
}

.card-title {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.card-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

/* Card Body */
.card-body {
    padding: var(--space-4) 0;
}

/* Card Footer */
.card-footer {
    padding-top: var(--space-4);
    margin-top: var(--space-4);
    border-top: 1px solid var(--color-border-primary);
}

/* ========================================
   BADGES & TAGS
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-none);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary-800);
}

.badge-accent {
    background: var(--accent-100);
    color: var(--accent-800);
}

.badge-success {
    background: var(--success-100);
    color: var(--success-800);
}

.badge-warning {
    background: var(--warning-100);
    color: var(--warning-800);
}

.badge-error {
    background: var(--error-100);
    color: var(--error-800);
}

/* Gradient Badge */
.badge-gradient {
    background: linear-gradient(135deg, var(--accent-400), var(--primary-600));
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

/* Tag (larger than badge) */
.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
    background: var(--primary-50);
    color: var(--primary-700);
    transition: var(--transition-colors);
}

.tag:hover {
    background: var(--primary-100);
    color: var(--primary-800);
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav {
    display: flex;
    gap: var(--space-2);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-colors);
}

.nav-link:hover {
    color: var(--color-text-primary);
    background: var(--neutral-100);
}

.nav-link.active {
    color: var(--color-accent);
    background: var(--accent-50);
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background: var(--white);
    border: 2px solid var(--color-border-primary);
    border-radius: var(--radius-md);
    transition: var(--transition-all);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-tertiary);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--error-600);
}

.form-help {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
}

/* ========================================
   ICONS
   ======================================== */

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
}

.icon-sm {
    width: 1rem;
    height: 1rem;
}

.icon-lg {
    width: 2rem;
    height: 2rem;
}

.icon-xl {
    width: 3rem;
    height: 3rem;
}

/* Icon with Background */
.icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    background: var(--primary-50);
    color: var(--primary-600);
}

.icon-box-accent {
    background: var(--accent-50);
    color: var(--accent-600);
}

.icon-box-gradient {
    background: linear-gradient(135deg, var(--accent-400), var(--primary-600));
    color: var(--white);
    box-shadow: var(--shadow-md);
}

/* ========================================
   DIVIDERS
   ======================================== */

.divider {
    height: 1px;
    background: var(--color-border-primary);
    margin: var(--space-8) 0;
}

.divider-vertical {
    width: 1px;
    height: 100%;
    background: var(--color-border-primary);
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    border-left: 4px solid;
    margin-bottom: var(--space-4);
}

.alert-info {
    background: var(--info-50);
    border-color: var(--info-500);
    color: var(--info-900);
}

.alert-success {
    background: var(--success-50);
    border-color: var(--success-500);
    color: var(--success-900);
}

.alert-warning {
    background: var(--warning-50);
    border-color: var(--warning-500);
    color: var(--warning-900);
}

.alert-error {
    background: var(--error-50);
    border-color: var(--error-500);
    color: var(--error-900);
}

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

.skeleton {
    background: linear-gradient(90deg,
            var(--neutral-200) 0%,
            var(--neutral-100) 50%,
            var(--neutral-200) 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 {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--neutral-200);
    border-top-color: var(--accent-500);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

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

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

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-2) var(--space-3);
    background: var(--neutral-900);
    color: var(--white);
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--duration-200) var(--ease-in-out);
    z-index: var(--z-tooltip);
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

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

@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .show-mobile {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .hide-tablet {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .show-tablet {
        display: none !important;
    }
}