/**
 * BAD-CER-IFD Theme - Components CSS
 *
 * Additional component styles
 *
 * @package BAD_CER_IFD
 */

/* ========================================
   PROGRESS BARS
   ======================================== */
.financing-progress {
    margin: 20px 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
}

.progress-bar {
    height: 10px;
    background: var(--ip-gray-200);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ip-success) 0%, #34d399 100%);
    border-radius: 5px;
    transition: width 1s ease;
}

.progress-gap {
    font-size: 12px;
    color: var(--ip-danger);
    margin-top: 8px;
    text-align: right;
}

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumbs {
    padding: 15px 0;
    font-size: 14px;
    color: var(--ip-gray-500);
}

.breadcrumbs a {
    color: var(--ip-blue);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .separator {
    margin: 0 8px;
    opacity: 0.5;
}

.breadcrumbs .current {
    color: var(--ip-gray-700);
}

/* ========================================
   TIMELINE
   ======================================== */
.timeline {
    position: relative;
    padding-left: 30px;
}

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

.timeline-item {
    position: relative;
    padding-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--ip-gold);
    border-radius: 50%;
    border: 3px solid var(--ip-white);
    box-shadow: 0 0 0 2px var(--ip-gold);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-date {
    font-size: 12px;
    color: var(--ip-gray-500);
    margin-bottom: 5px;
}

.timeline-content {
    background: var(--ip-white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.timeline-content h4 {
    margin-bottom: 8px;
    font-size: 16px;
}

.timeline-content p {
    margin: 0;
    font-size: 14px;
    color: var(--ip-gray-600);
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-content h4 {
    margin: 0 0 5px;
    font-size: 15px;
}

.alert-content p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* ========================================
   TABS
   ======================================== */
.tabs {
    margin-bottom: 30px;
}

.tabs-nav {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--ip-gray-200);
    margin-bottom: 25px;
}

.tab-link {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--ip-gray-500);
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.tab-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--ip-gold);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.tab-link:hover {
    color: var(--ip-gray-700);
}

.tab-link.active {
    color: var(--ip-blue);
}

.tab-link.active::after {
    transform: scaleX(1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.modal {
    background: var(--ip-white);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--ip-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--ip-gray-100);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--ip-gray-200);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--ip-gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ========================================
   TOOLTIPS
   ======================================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    background: var(--ip-gray-900);
    color: var(--ip-white);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    margin-bottom: 8px;
}

[data-tooltip]::after {
    content: '';
    border: 6px solid transparent;
    border-top-color: var(--ip-gray-900);
    margin-bottom: -4px;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   AVATAR
   ======================================== */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ip-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--ip-blue-dark);
    font-size: 14px;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 80px; height: 80px; font-size: 24px; }

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    margin-left: -10px;
    border: 2px solid var(--ip-white);
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* ========================================
   SKELETON LOADER
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, var(--ip-gray-200) 25%, var(--ip-gray-100) 50%, var(--ip-gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

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

.skeleton-text {
    height: 16px;
    margin-bottom: 10px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 15px;
}

.skeleton-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.skeleton-card {
    background: var(--ip-white);
    border-radius: 16px;
    padding: 20px;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 40px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--ip-gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 32px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--ip-gray-500);
    margin-bottom: 25px;
}

/* ========================================
   DROPDOWN
   ======================================== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--ip-white);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 1000;
}

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

.dropdown-menu a,
.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 10px 20px;
    text-align: left;
    background: none;
    border: none;
    font-size: 14px;
    color: var(--ip-gray-700);
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: var(--ip-gray-50);
    color: var(--ip-blue);
}

.dropdown-divider {
    height: 1px;
    background: var(--ip-gray-200);
    margin: 8px 0;
}

/* ========================================
   NOTIFICATION DOT
   ======================================== */
.notification-dot {
    position: relative;
}

.notification-dot::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--ip-danger);
    border-radius: 50%;
    border: 2px solid var(--ip-white);
}

.notification-dot.success::after {
    background: var(--ip-success);
}

.notification-dot.warning::after {
    background: var(--ip-warning);
}

/* ========================================
   KPI CARDS
   ======================================== */
.kpi-card {
    background: var(--ip-white);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.kpi-card.primary::before { background: var(--ip-blue); }
.kpi-card.gold::before { background: var(--ip-gold); }
.kpi-card.success::before { background: var(--ip-success); }
.kpi-card.warning::before { background: var(--ip-warning); }
.kpi-card.danger::before { background: var(--ip-danger); }

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 15px;
}

.kpi-card.primary .kpi-icon { background: #e0e7ff; color: var(--ip-blue); }
.kpi-card.gold .kpi-icon { background: #fef3c7; color: var(--ip-gold-dark); }
.kpi-card.success .kpi-icon { background: #d1fae5; color: var(--ip-success); }
.kpi-card.warning .kpi-icon { background: #ffedd5; color: var(--ip-warning); }
.kpi-card.danger .kpi-icon { background: #fee2e2; color: var(--ip-danger); }

.kpi-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 5px;
}

.kpi-label {
    font-size: 13px;
    color: var(--ip-gray-500);
}

.kpi-change {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 20px;
}

.kpi-change.up {
    background: #d1fae5;
    color: #065f46;
}

.kpi-change.down {
    background: #fee2e2;
    color: #991b1b;
}
