/**
 * Verdara Tax CRM - Component Library
 *
 * Reusable UI components following the design system
 *
 * @package Verdara
 * @version 1.0.0
 */

/* ============================================
   TAX-SPECIFIC COMPONENTS
   ============================================ */

/* Tax Stage Badges */
.badge-stage {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.badge-stage-collection {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.badge-stage-processing {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.badge-stage-review {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

.badge-stage-filed {
    background: rgba(0, 88, 64, 0.1);
    color: var(--color-success);
}

.badge-stage-refunded {
    background: rgba(0, 88, 64, 0.2);
    color: var(--color-success);
    font-weight: var(--font-bold);
}

/* Progress Tracker */
.progress-tracker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: var(--space-6) 0;
    margin: var(--space-8) 0;
}

.progress-tracker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-gray-200);
    z-index: 0;
    transform: translateY(-50%);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    position: relative;
    z-index: 1;
    flex: 1;
}

.progress-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--color-gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-semibold);
    color: var(--color-gray-400);
    transition: all var(--transition-base);
    font-size: var(--text-sm);
}

.progress-step.active .progress-icon {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: white;
    box-shadow: var(--shadow-md);
}

.progress-step.completed .progress-icon {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

.progress-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-gray-500);
    text-align: center;
}

.progress-step.active .progress-label {
    color: var(--color-primary);
}

.progress-step.completed .progress-label {
    color: var(--color-success);
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--color-gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.progress-bar::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%); }
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border-left: 4px solid var(--color-primary);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(0, 50, 28, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
}

.stat-card-title {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-value {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: var(--color-primary-dark);
    margin-bottom: var(--space-2);
}

.stat-card-change {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.stat-card-change.positive {
    color: var(--color-success);
}

.stat-card-change.negative {
    color: var(--color-error);
}

/* Document Category Card */
.document-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.category-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.category-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.category-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--color-support);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-3xl);
    flex-shrink: 0;
}

.category-info {
    flex: 1;
}

.category-info h4 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-primary-dark);
    margin-bottom: var(--space-1);
}

.category-count {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
}

.category-action {
    flex-shrink: 0;
}

/* Refund Display Card */
.refund-card {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    color: white;
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-8);
}

.refund-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.refund-header h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    color: white;
    opacity: 0.9;
}

.refund-status {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
}

.refund-amount {
    font-size: 48px;
    font-weight: var(--font-bold);
    color: white;
    margin-bottom: var(--space-6);
    line-height: 1;
}

.refund-details {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: var(--space-4);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    color: white;
    font-size: var(--text-sm);
}

.detail-row span {
    opacity: 0.8;
}

.detail-row strong {
    font-weight: var(--font-semibold);
}

/* Document Card */
.document-card {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
    transition: all var(--transition-fast);
}

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

.document-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--color-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    flex-shrink: 0;
}

.document-info {
    flex: 1;
}

.document-name {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-primary-dark);
    margin-bottom: var(--space-1);
}

.document-meta {
    font-size: var(--text-xs);
    color: var(--color-gray-500);
    display: flex;
    gap: var(--space-3);
}

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

.document-actions button {
    padding: var(--space-2);
    border: none;
    background: var(--color-gray-100);
    color: var(--color-gray-600);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--text-sm);
}

.document-actions button:hover {
    background: var(--color-primary);
    color: white;
}

/* File Upload Zone */
.upload-zone {
    border: 2px dashed var(--color-gray-300);
    border-radius: var(--radius-lg);
    padding: var(--space-12);
    text-align: center;
    background: var(--color-gray-50);
    cursor: pointer;
    transition: all var(--transition-base);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--color-primary);
    background: rgba(0, 50, 28, 0.05);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    border-radius: var(--radius-full);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-3xl);
    box-shadow: var(--shadow-sm);
}

.upload-text {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-primary-dark);
    margin-bottom: var(--space-2);
}

.upload-hint {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
}

/* Calendar Day Cell */
.calendar-day {
    padding: var(--space-3);
    text-align: center;
    border: 1px solid var(--color-gray-200);
    min-height: 80px;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: white;
}

.calendar-day:hover {
    background: var(--color-gray-50);
    border-color: var(--color-primary);
}

.calendar-day.available {
    background: rgba(0, 88, 64, 0.05);
}

.calendar-day.selected {
    background: var(--color-primary);
    color: white;
}

.calendar-day.disabled {
    background: var(--color-gray-100);
    color: var(--color-gray-400);
    cursor: not-allowed;
}

.calendar-day-number {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
}

.calendar-day-appointments {
    font-size: var(--text-xs);
    color: var(--color-gray-600);
}

/* Timeline Item */
.timeline {
    position: relative;
    padding-left: var(--space-8);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-6);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -37px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 3px solid white;
    box-shadow: var(--shadow-sm);
}

.timeline-date {
    font-size: var(--text-xs);
    color: var(--color-gray-500);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-2);
}

.timeline-content {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
}

.timeline-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-primary-dark);
    margin-bottom: var(--space-1);
}

.timeline-description {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-16);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    border-radius: var(--radius-full);
    background: var(--color-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

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

.empty-state-description {
    font-size: var(--text-base);
    color: var(--color-gray-600);
    margin-bottom: var(--space-6);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Data Table */
.data-table {
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--color-gray-50);
}

.data-table th {
    padding: var(--space-4) var(--space-6);
    text-align: left;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-gray-200);
}

.data-table td {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-sm);
    color: var(--color-text);
    border-bottom: 1px solid var(--color-gray-200);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--color-gray-50);
}

/* Action Buttons in Table */
.table-actions {
    display: flex;
    gap: var(--space-2);
}

.table-action-btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
    border: none;
    background: var(--color-gray-100);
    color: var(--color-gray-700);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.table-action-btn:hover {
    background: var(--color-primary);
    color: white;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-2);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: var(--space-2);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-gray-700);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.dropdown-item:hover {
    background: var(--color-gray-100);
    color: var(--color-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--color-gray-200);
    margin: var(--space-2) 0;
}

/* Tabs */
.tabs {
    border-bottom: 2px solid var(--color-gray-200);
    margin-bottom: var(--space-6);
}

.tab-list {
    display: flex;
    gap: var(--space-6);
    list-style: none;
}

.tab-item {
    padding: var(--space-4) var(--space-2);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--color-gray-600);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all var(--transition-fast);
    position: relative;
    top: 2px;
}

.tab-item:hover {
    color: var(--color-primary);
}

.tab-item.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 60px;
    height: 60px;
}

/* Avatar */
.verdara-avatar {
    border-radius: var(--radius-full);
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-error);
    color: white;
    font-size: 10px;
    font-weight: var(--font-bold);
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 300px;
    opacity: 0;
    transform: translateX(400px);
    transition: all var(--transition-base);
    z-index: 10000;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
}

.toast.success .toast-icon {
    background: rgba(0, 88, 64, 0.1);
    color: var(--color-success);
}

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.toast.warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.toast.info .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-primary-dark);
    margin-bottom: var(--space-1);
}

.toast-message {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
}

.toast-close {
    background: none;
    border: none;
    color: var(--color-gray-400);
    cursor: pointer;
    font-size: var(--text-xl);
    line-height: 1;
    padding: 0;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--color-gray-700);
}
