/* Header Styles */
.app-header {
    position: fixed;
    top: 0;
    left: 220px;
    height: 5rem;
    right: 0;
    z-index: 1030;
    background: white;
    border-bottom: 1px solid var(--bs-border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
}

@media (max-width: 992px) {
    .app-header {
        left: 0;
    }
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: white;
    border-right: 1px solid var(--bs-border-color);
    z-index: 1040;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.sidebar.active {
    transform: translateX(0);
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
}

/* Menu Toggle */
.menu-toggle {
    display: none;
}

@media (max-width: 992px) {
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
    }
}

/* Logo */
.logo-img {
    height: 8rem; 
    width: auto;
}

/* Country Selector */
.country-selector {
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.country-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    border: 1px solid var(--bs-border-color);
}

/* Balance Card */
.balance-card {
    background: var(--bs-success);
    color: white;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Notifications */
.notifications-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--bs-danger);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* User Profile */
.user-profile {
    cursor: pointer;
    padding: 0.25rem 0.5rem 0.25rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--bs-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Dropdowns */
.notifications-dropdown,
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: white;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1050;
}

.notifications-dropdown.show,
.user-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Notification Items */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: var(--bs-light);
}

.notification-item.unread {
    background-color: rgba(79, 70, 229, 0.05);
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--bs-success);
}

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

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

/* Sidebar Styles */
.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem 0.75rem;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.user-avatar-sidebar {
    width: 48px;
    height: 48px;
    background: var(--bs-primary);
    color: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.sidebar-close {
    background: var(--bs-light);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-secondary);
    width: 36px;
    height: 36px;
    border-radius: 0.375rem;
    display: none;
    align-items: center;
    justify-content: center;
}

.sidebar-close:hover {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    margin-bottom: 1.5rem;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bs-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--bs-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

.nav-item i {
    font-size: 1rem;
}

.nav-item span {
    font-size: 0.9rem;
}

.nav-item:hover {
    background-color: var(--bs-light);
    color: var(--bs-dark);
}

.nav-item.active {
    background-color: var(--bs-primary);
    color: white;
}

.nav-badge {
    background: var(--bs-danger);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bs-border-color);
}

.balance-card-sidebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bs-light);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.btn-add-funds {
    width: 30px;
    height: 30px;
    background: var(--bs-success);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout-sidebar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bs-light);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    color: var(--bs-dark);
    font-weight: 500;
}

.btn-logout-sidebar:hover {
    background: var(--bs-danger);
    border-color: var(--bs-danger);
    color: white;
}

/* Enhanced Table Styling */
#contactsTable {
    font-size: 0.875rem;
}

#contactsTable th:first-child,
#contactsTable td:first-child {
    padding-left: 1.5rem;
}

#contactsTable th:last-child,
#contactsTable td:last-child {
    padding-right: 1.5rem;
}

/* Checkbox column styling */
.table .form-check-input {
    cursor: pointer;
    transition: all 0.2s ease;
}

.table .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.25);
}

/* Hover effect on rows */
#contactsTable tbody tr {
    transition: all 0.2s ease;
}

#contactsTable tbody tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Selected row animation */
.table-selected {
    animation: highlightRow 0.3s ease;
}

@keyframes highlightRow {
    from {
        background-color: rgba(79, 70, 229, 0.05);
    }
    to {
        background-color: rgba(79, 70, 229, 0.1);
    }
}

/* Table header sticky on scroll */
/* .table-responsive {
    max-height: 400px;
    overflow-y: auto;
} */

.table-responsive thead th {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Empty state for table */
.table-empty-state {
    padding: 3rem;
    text-align: center;
    color: #94a3b8;
}

.table-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Loading state */
.table-loading {
    position: relative;
    min-height: 200px;
}

.table-loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f1f5f9;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .header-center {
        display: none;
    }
    
    .country-selector {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .balance-card .balance-info {
        display: none;
    }
    
    .phone-frame {
        max-width: 260px;
    }
    
    .phone-screen {
        min-height: 440px;
    }
}

@media (max-width: 576px) {
    .phone-frame {
        max-width: 240px;
    }
    
    .phone-screen {
        min-height: 400px;
    }
    
    .sidebar {
        width: 260px;
    }
}

/* Animation for slide up */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation for slide in */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Theme Toggle Button Styles */
.theme-toggle-container {
    margin-right: 0.5rem;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-light);
    color: var(--bs-body-color);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background-color: rgba(var(--bs-primary-rgb, 79, 70, 229), 0.1);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    transform: translateY(-1px);
}

.theme-toggle i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(15deg);
}

/* Ensure theme toggle is visible on mobile */
@media (max-width: 768px) {
    .theme-toggle-container {
        margin-right: 0.25rem;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
    }
    .sidebar-close{
        display: block;
    }
}