/* Enhanced Design System Components */
/* Version: 2.0 - Contemporary Redesign Components */

/* ===== MODERN BUTTON SYSTEM ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    min-height: 44px; /* Accessibility: minimum touch target */
}

/* Button Variants */
.btn-primary {
    background: var(--color-navy);
    color: var(--color-white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #1e40af; /* Darker navy on hover */
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--color-teal);
    color: var(--color-white);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #0d5a52; /* Darker teal on hover */
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--color-navy);
    border: 2px solid var(--color-navy);
}

.btn-outline:hover {
    background: var(--color-navy);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: transparent;
    color: var(--color-charcoal);
}

.btn-ghost:hover {
    background: var(--color-ash);
    transform: translateY(-1px);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    min-height: 36px;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
    min-height: 52px;
}

.btn-pill {
    border-radius: var(--radius-pill);
}

.btn-2xl {
    border-radius: var(--radius-2xl);
}

/* ===== ENHANCED CARD SYSTEM ===== */

.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--color-ash);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--color-ash);
    background: var(--color-porcelain);
}

/* Card Variants */
.card-elevated {
    box-shadow: var(--shadow-md);
}

.card-elevated:hover {
    box-shadow: var(--shadow-xl);
}

.card-interactive {
    cursor: pointer;
    transition: all var(--transition-bounce);
}

.card-interactive:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-2xl);
}

/* ===== MODERN FORM ELEMENTS ===== */

.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    color: var(--color-charcoal);
    font-size: var(--text-sm);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--color-ash);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--text-base);
    transition: all var(--transition-normal);
    background: var(--color-white);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-navy);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-input:hover {
    border-color: var(--color-pewter);
}

.form-input.error {
    border-color: var(--color-error);
}

.form-input.success {
    border-color: var(--color-success);
}

/* Search Input */
.search-input {
    padding: var(--space-3) var(--space-6);
    border: 2px solid var(--color-ash);
    border-radius: var(--radius-pill);
    font-family: var(--font-family);
    font-size: var(--text-base);
    transition: all var(--transition-normal);
    background: var(--color-white);
    width: 100%;
    max-width: 400px;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-navy);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.search-input:hover {
    border-color: var(--color-pewter);
}

/* ===== ENHANCED NAVIGATION COMPONENTS ===== */

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    color: var(--color-charcoal);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    font-weight: 500;
}

.nav-link:hover {
    background: var(--color-ash);
    color: var(--color-navy);
    transform: translateX(4px);
}

.nav-link.active {
    background: var(--color-navy);
    color: var(--color-white);
}

.nav-link.active:hover {
    background: #1e40af;
    transform: none;
}

/* ===== UTILITY COMPONENTS ===== */

/* Hover Effects */
.hover\:text-navy:hover {
    color: var(--color-navy);
}

.hover\:text-teal:hover {
    color: var(--color-teal);
}

.hover\:text-orange:hover {
    color: var(--color-orange);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: var(--color-navy);
    color: var(--color-white);
}

.badge-secondary {
    background: var(--color-teal);
    color: var(--color-white);
}

.badge-success {
    background: var(--color-success);
    color: var(--color-white);
}

.badge-warning {
    background: var(--color-warning);
    color: var(--color-white);
}

.badge-error {
    background: var(--color-error);
    color: var(--color-white);
}

/* ===== ANIMATION UTILITIES ===== */

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== RESPONSIVE UTILITIES ===== */

@media (max-width: 768px) {
    .btn {
        padding: var(--space-4) var(--space-6);
        min-height: 48px; /* Larger touch targets on mobile */
    }
    
    .card {
        margin: var(--space-4);
    }
    
    .search-input {
        max-width: 100%;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* Focus indicators for keyboard navigation */
.btn:focus-visible,
.form-input:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--color-navy);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .card,
    .nav-link,
    .form-input {
        transition: none;
    }
    
    .btn:hover,
    .card:hover,
    .nav-link:hover {
        transform: none;
    }
}

/* ==========================================================================
   CSS Overrides to Ensure New Design System Takes Precedence
   ========================================================================== */

/* Force new button styles to override old styles */
.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-ghost {
    /* Use !important to override conflicting styles */
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition-normal) !important;
    border-radius: var(--radius-md) !important;
    font-family: var(--font-family) !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: var(--space-2) !important;
    cursor: pointer !important;
    border: none !important;
    outline: none !important;
}

.btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-md) !important;
}

.btn-primary {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
}

.btn-primary:hover {
    background: var(--color-primary-dark) !important;
}

.btn-secondary {
    background: var(--color-secondary) !important;
    color: var(--color-primary) !important;
}

.btn-secondary:hover {
    background: var(--color-secondary-dark) !important;
}

.btn-outline {
    background: transparent !important;
    color: var(--color-primary) !important;
    border: 2px solid var(--color-primary) !important;
}

.btn-outline:hover {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
}

.btn-ghost {
    background: transparent !important;
    color: var(--color-primary) !important;
}

.btn-ghost:hover {
    background: var(--color-primary-light) !important;
}

/* Force new card styles */
.card,
.card-elevated {
    background: var(--color-white) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition-normal) !important;
}

.card-elevated:hover {
    transform: translateY(-4px) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* Force new badge styles */
.badge {
    background: var(--color-secondary) !important;
    color: var(--color-primary) !important;
    border-radius: var(--radius-full) !important;
    font-size: var(--text-sm) !important;
    font-weight: 500 !important;
    padding: var(--space-1) var(--space-3) !important;
    display: inline-block !important;
}
