/* /home/bretqidw/apps/syndicators/mca/static/css/shared.css */

/* Premium fonts and base styles */
body {
    font-family: 'Montserrat', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Premium gradient backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, #D4AF37 0%, #b8941f 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.gradient-info {
    background: linear-gradient(135deg, #D4AF37 0%, transparent 100%);
}

.gradient-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

/* Enhanced premium card styles */
.card-professional {
    background: white;
    border-radius: 15px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #D4AF37;
    position: relative;
}

.card-professional::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #D4AF37, transparent, #D4AF37);
    border-radius: 17px;
    z-index: -1;
}

.card-professional:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* Stat card with premium design */
.stat-card {
    position: relative;
    overflow: hidden;
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    border: 2px solid #D4AF37;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #D4AF37, transparent, #D4AF37);
    border-radius: 17px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(-4px);
}

/* Icon backgrounds with premium gradients */
.icon-gradient-gold {
    background: linear-gradient(135deg, #D4AF37 0%, #b8941f 100%);
}

.icon-gradient-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.icon-gradient-slate {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.icon-gradient-orange {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* Modern professional table styles */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    position: sticky;
    top: 0;
    background: linear-gradient(to bottom, #f9fafb 0%, #f3f4f6 100%);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid #e5e7eb;
    z-index: 10;
}

.table-modern tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.table-modern tbody tr:hover {
    background: linear-gradient(to right, #f9fafb 0%, #ffffff 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table-modern tbody td {
    padding: 1rem 1.5rem;
    color: #1f2937;
}

/* Clickable table rows */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: linear-gradient(to right, #f0f9ff 0%, #ffffff 100%);
}

/* Document upload area */
.drop-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
}

.drop-area:hover, .drop-area.drag-over {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* Form groups and validation */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group label.required::after {
    content: " *";
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: 0;
}

.form-control.is-invalid {
    border-color: #ef4444;
}

.form-control.is-invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Additional validation styles for JavaScript */
.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

/* Form error messages */
.form-error {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #ef4444;
}

/* Modern professional buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #D4AF37 0%, #b8941f 100%);
    color: #1e293b;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(212, 175, 55, 0.4);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 10px 15px -3px rgba(212, 175, 55, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #e5e7eb;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
    border-color: #dc2626;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-xs {
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
}

/* Dynamic form sections */
.dynamic-form-section {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease-in-out;
}

.dynamic-form-section.is-auto {
    background-color: #eff6ff;
    border-color: #3b82f6;
}

.dynamic-form-section:hover {
    border-color: #9ca3af;
}

.dynamic-form-section .remove-btn {
    position: relative;
    top: -0.25rem;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Global loader spinner */
#global-loader .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f4f6;
    border-top-color: #3b82f6;
}

/* Document type selector */
.document-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.document-type-option {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
}

.document-type-option:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.document-type-option.selected {
    border-color: #3b82f6;
    background-color: #dbeafe;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* File list */
.file-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.file-list-item:last-child {
    margin-bottom: 0;
}

/* Tooltips */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Alpine.js cloaking */
[x-cloak] {
    display: none !important;
}

/* Inline editing styles */
.inline-edit-hover:hover .inline-edit-trigger {
    opacity: 1;
}

.inline-edit-trigger {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Mobile menu improvements */
#mobile-menu-button {
    display: block;
}

@media (min-width: 768px) {
    #mobile-menu-button {
        display: none;
    }
}

#mobile-menu {
    transition: all 0.3s ease-in-out;
    transform: translateY(-10px);
    opacity: 0;
}

#mobile-menu:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
}

/* Row click feedback */
.clickable-row {
    transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.clickable-row:active {
    background-color: #f3f4f6;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

/* Notification animations */
.notification-enter {
    transform: translateX(100%);
    opacity: 0;
}

.notification-enter-active {
    transform: translateX(0);
    opacity: 1;
    transition: all 0.3s ease-out;
}

.notification-exit {
    transform: translateX(0);
    opacity: 1;
}

.notification-exit-active {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in;
}

/* Delete confirmation modal */
.modal-backdrop {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Modern status badges with animations */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.status-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Section header styles */
.section-header {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(184, 148, 31, 0.1) 100%);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 2px solid rgba(212, 175, 55, 0.3);
    color: #92400e;
}

/* Progress bars */
.progress-bar {
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #D4AF37 0%, #b8941f 100%);
    border-radius: 9999px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .document-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dynamic-form-section {
        padding: 0.75rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Stack mobile cards */
    .mobile-stack {
        flex-direction: column;
    }
    
    .mobile-stack > * {
        margin-bottom: 0.5rem;
    }
    
    .mobile-stack > *:last-child {
        margin-bottom: 0;
    }
}

/* Modal adjustments */
#docTypeModal .modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

/* Ensure modals are properly layered */
.modal-overlay {
    z-index: 1000;
}

.modal-content {
    z-index: 1001;
}

/* Hide templates by default */
template {
    display: none !important;
}

/* Debug helper - remove in production */
.debug-border {
    border: 1px solid red !important;
}

/* Timeline styles for envelope details */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-marker {
    position: absolute;
    left: -25px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #dee2e6;
}

.timeline-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.timeline-text {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .clickable-row {
        cursor: default;
    }
    
    .btn {
        display: none;
    }
}