/* ===============================================
   SINet - Components Stylesheet
   Reusable UI components with animations
   =============================================== */

/* ===============================================
   Progress Bars
   =============================================== */
.progress-bar-custom {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    transition: width 1s ease-out;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===============================================
   Status Badges
   =============================================== */
.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.badge-online {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.badge-online::before {
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.badge-offline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.badge-offline::before {
    background: var(--error-color);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-pending::before {
    background: var(--warning-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===============================================
   Data Cards
   =============================================== */
.data-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 20px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.data-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.data-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.data-card:hover::before {
    transform: scaleX(1);
}

.data-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.data-card-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.data-card-title i {
    color: var(--primary-color);
}

.data-card-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===============================================
   Info List
   =============================================== */
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.info-list-item:last-child {
    border-bottom: none;
}

.info-list-item:hover {
    background: rgba(25, 118, 210, 0.05);
    padding-left: 10px;
    border-radius: var(--radius-sm);
}

.info-list-item::before {
    content: '→';
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 12px;
    transition: transform var(--transition-fast);
}

.info-list-item:hover::before {
    transform: translateX(5px);
}

.info-label {
    color: var(--text-muted);
    min-width: 120px;
    font-size: 14px;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===============================================
   Notification Badges
   =============================================== */
.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: attr(data-count);
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    background: var(--error-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    animation: pop 0.3s ease;
}

@keyframes pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ===============================================
   Tabs
   =============================================== */
.nav-tabs-custom {
    border-bottom: 2px solid var(--border-color);
    display: flex;
    gap: 5px;
}

.nav-tabs-custom .nav-link {
    padding: 12px 24px;
    color: var(--text-secondary);
    border: none;
    background: transparent;
    position: relative;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.nav-tabs-custom .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.nav-tabs-custom .nav-link:hover {
    color: var(--primary-color);
}

.nav-tabs-custom .nav-link:hover::after {
    transform: scaleX(0.5);
}

.nav-tabs-custom .nav-link.active {
    color: var(--primary-color);
}

.nav-tabs-custom .nav-link.active::after {
    transform: scaleX(1);
}

/* ===============================================
   Accordion
   =============================================== */
.accordion-custom .accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 10px;
    overflow: hidden;
}

.accordion-custom .accordion-button {
    padding: 18px 20px;
    font-weight: 600;
    background: var(--bg-card);
    transition: all var(--transition-normal);
}

.accordion-custom .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    color: var(--primary-color);
}

.accordion-custom .accordion-body {
    padding: 20px;
}

/* ===============================================
   Loading States
   =============================================== */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 1.4s infinite both;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Skeleton Loader */
.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-circle {
    width: 48px;
    height: 48px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 50%;
}

/* ===============================================
   Alerts
   =============================================== */
.alert-custom {
    padding: 16px 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.alert-custom i {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-info {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    border-left: 4px solid var(--primary-color);
    color: var(--primary-dark);
}

.alert-success {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-left: 4px solid var(--success-color);
    color: #166534;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left: 4px solid var(--warning-color);
    color: #92400e;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-left: 4px solid var(--error-color);
    color: #991b1b;
}

/* ===============================================
   Timeline
   =============================================== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
    padding-left: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--bg-page);
    box-shadow: 0 0 0 2px var(--primary-color);
    transition: all var(--transition-normal);
}

.timeline-item:hover::before {
    transform: scale(1.3);
    box-shadow: 0 0 0 3px var(--primary-light), 0 0 15px var(--primary-color);
}

.timeline-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-content {
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.timeline-item:hover .timeline-content {
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

/* ===============================================
   Search Box
   =============================================== */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    font-size: 15px;
    transition: all var(--transition-normal);
    background: var(--bg-card);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.1);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-box button:hover {
    background: var(--primary-dark);
    transform: translateY(-50%) scale(1.1);
}

/* ===============================================
   Floating Action Button
   =============================================== */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 10px 30px rgba(25, 118, 210, 0.4);
}

/* ===============================================
   Packets Table Styles (Shared)
   =============================================== */
.packets-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.packets-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.packets-table thead th {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.packets-table tbody tr {
    transition: background-color var(--transition-fast);
}

.packets-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.packets-table tbody tr:hover {
    background-color: #e0f2fe;
}

.packets-table tbody td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.packets-table tbody td a {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
}

.packets-table tbody td a:hover {
    text-decoration: underline;
}

/* Packet Status Badges */
.packet-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.packet-status-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.packet-status-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

/* ===============================================
   Pagination Styles (Shared)
   =============================================== */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin: 20px;
}

.pagination .page-item .page-link {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    transition: all var(--transition-fast);
}

.pagination .page-item .page-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: var(--text-secondary);
    background-color: #f1f5f9;
}
