/* ========================================
   SMARTFORMS - PROFESSIONAL UI ENHANCEMENTS
   Subtle improvements while preserving brand colors
   ======================================== */

/* ========================================
   TYPOGRAPHY REFINEMENTS
   ======================================== */

body {
    font-feature-settings: 'kern' 1, 'liga' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
    font-weight: 600;
}

/* ========================================
   SUBTLE SHADOWS & DEPTH
   ======================================== */

.card-enhanced,
.bg-white {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05),
                0 1px 2px -1px rgba(0, 0, 0, 0.05);
}

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08),
                0 8px 10px -6px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* ========================================
   BUTTON ENHANCEMENTS
   ======================================== */

button,
.btn {
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:active,
.btn:active {
    transform: scale(0.98);
}

/* Primary button enhancement */
.bg-primary,
button.bg-primary {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 4px 6px -1px rgba(29, 78, 216, 0.2),
                0 2px 4px -2px rgba(29, 78, 216, 0.2);
}

.bg-primary:hover,
button.bg-primary:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    box-shadow: 0 10px 15px -3px rgba(29, 78, 216, 0.3),
                0 4px 6px -4px rgba(29, 78, 216, 0.3);
}

/* Secondary button enhancement */
.btn-secondary {
    background: rgba(29, 78, 216, 0.05);
    color: #1d4ed8;
    border: 1px solid rgba(29, 78, 216, 0.2);
}

.btn-secondary:hover {
    background: rgba(29, 78, 216, 0.1);
    border-color: rgba(29, 78, 216, 0.3);
}

/* ========================================
   INPUT FIELD REFINEMENTS
   ======================================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
textarea,
select {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ffffff;
}

input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.08),
                0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border-color: #1d4ed8;
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: #9ca3af;
    opacity: 0.7;
}

/* ========================================
   FORM CARD ENHANCEMENTS
   ======================================== */

.form-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.form-card:hover {
    border-color: rgba(29, 78, 216, 0.15);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.06);
}

/* ========================================
   TABLE IMPROVEMENTS
   ======================================== */

table {
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #6b7280;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 2px solid #e5e7eb;
}

tbody tr {
    transition: background-color 0.15s ease;
}

tbody tr:hover {
    background-color: rgba(29, 78, 216, 0.02);
}

tbody td {
    border-bottom: 1px solid #f3f4f6;
}

/* ========================================
   BADGE & TAG ENHANCEMENTS
   ======================================== */

.badge,
.tag {
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-primary {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.1), rgba(29, 78, 216, 0.15));
    color: #1d4ed8;
    border: 1px solid rgba(29, 78, 216, 0.2);
}

.badge-success {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.1), rgba(22, 163, 74, 0.15));
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.badge-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.15));
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.15));
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ========================================
   MODAL ENHANCEMENTS
   ======================================== */

.modal-backdrop {
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15),
                0 8px 10px -6px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ========================================
   DROPDOWN MENU REFINEMENTS
   ======================================== */

.dropdown-menu {
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12),
                0 8px 10px -6px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    transition: all 0.15s ease;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: rgba(29, 78, 216, 0.06);
    color: #1d4ed8;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ========================================
   ICON ENHANCEMENTS
   ======================================== */

.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0.625rem;
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.08), rgba(29, 78, 216, 0.12));
    color: #1d4ed8;
}

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

.icon-md {
    width: 2.5rem;
    height: 2.5rem;
}

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

/* ========================================
   ALERT & NOTIFICATION IMPROVEMENTS
   ======================================== */

.alert {
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border-left: 4px solid;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.06);
}

.alert-info {
    background: linear-gradient(to right, rgba(29, 78, 216, 0.05), rgba(29, 78, 216, 0.02));
    border-left-color: #1d4ed8;
    color: #1e40af;
}

.alert-success {
    background: linear-gradient(to right, rgba(22, 163, 74, 0.05), rgba(22, 163, 74, 0.02));
    border-left-color: #16a34a;
    color: #15803d;
}

.alert-warning {
    background: linear-gradient(to right, rgba(245, 158, 11, 0.05), rgba(245, 158, 11, 0.02));
    border-left-color: #f59e0b;
    color: #d97706;
}

.alert-error {
    background: linear-gradient(to right, rgba(239, 68, 68, 0.05), rgba(239, 68, 68, 0.02));
    border-left-color: #ef4444;
    color: #dc2626;
}

/* ========================================
   PROGRESS BAR ENHANCEMENTS
   ======================================== */

.progress-bar {
    height: 8px;
    border-radius: 9999px;
    background-color: rgba(29, 78, 216, 0.1);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1d4ed8, #2563eb);
    border-radius: 9999px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(29, 78, 216, 0.4);
}

/* ========================================
   CHECKBOX & RADIO REFINEMENTS
   ======================================== */

input[type="checkbox"],
input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid #d1d5db;
    transition: all 0.2s ease;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
    border-color: #1d4ed8;
}

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

.skeleton {
    background: linear-gradient(90deg, 
        #f3f4f6 0%, 
        #e5e7eb 50%, 
        #f3f4f6 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spinner {
    border: 3px solid rgba(29, 78, 216, 0.1);
    border-top-color: #1d4ed8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   TOOLTIP ENHANCEMENTS
   ======================================== */

.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 0.75rem;
    background-color: #1f2937;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ========================================
   BREADCRUMB IMPROVEMENTS
   ======================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: #6b7280;
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: #1d4ed8;
}

.breadcrumb-item.active {
    color: #1f2937;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #d1d5db;
}

/* ========================================
   TABS ENHANCEMENT
   ======================================== */

.tab-list {
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    gap: 0.5rem;
}

.tab-item {
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tab-item:hover {
    color: #1d4ed8;
    background-color: rgba(29, 78, 216, 0.03);
}

.tab-item.active {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
    background-color: rgba(29, 78, 216, 0.05);
}

/* ========================================
   PAGINATION REFINEMENTS
   ======================================== */

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-item {
    min-width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.pagination-item:hover {
    background-color: rgba(29, 78, 216, 0.06);
    border-color: rgba(29, 78, 216, 0.2);
    color: #1d4ed8;
}

.pagination-item.active {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 2px 4px rgba(29, 78, 216, 0.2);
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #cbd5e1, #94a3b8);
    border-radius: 10px;
    border: 2px solid #f3f4f6;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #94a3b8, #64748b);
}

/* ========================================
   FOCUS VISIBLE (Accessibility)
   ======================================== */

*:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========================================
   SMOOTH TRANSITIONS
   ======================================== */

* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   GLASS MORPHISM EFFECT (Subtle)
   ======================================== */

.glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ========================================
   MICRO-INTERACTIONS
   ======================================== */

.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

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

@media (max-width: 768px) {
    .card-enhanced {
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .dropdown-menu {
        border-radius: 8px;
    }
}
