/**
 * Template Styles - Header & Common Layout
 * Used across all pages for sidebar, navigation, and common components
 */

/* User Panel Sidebar Styles */
.user-sidebar {
    background: linear-gradient(180deg, #1a1a1a 0%, #212121 50%, #1a1a1a 100%);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.user-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.user-sidebar.collapsed {
    width: 80px;
}

.user-sidebar .sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    z-index: 2;
}

.user-sidebar .sidebar-header .logo {
    color: white !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    padding: 0.5rem;
    border-radius: 0.75rem;
}

.user-sidebar .sidebar-header .logo:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-sidebar .sidebar-header .logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-sidebar .sidebar-header .logo-icon i {
    font-size: 1.5rem;
    color: white;
    transition: transform 0.3s ease;
}

.user-sidebar .sidebar-header .logo:hover .logo-icon {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.25) 100%);
    transform: scale(1.05);
}

.user-sidebar .sidebar-header .logo:hover .logo-icon i {
    transform: scale(1.1);
}

.user-sidebar .sidebar-header .logo-text {
    color: white !important;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.user-sidebar .sidebar-header .logo-text .logo-subtitle {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.product-pill {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-subtitle {
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    line-height: 1.5;
}

.flow-channel-grid {
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.flow-channel-grid span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
    color: white;
}

.flow-channel-grid span i {
    font-size: 1rem;
}

/* Collapsed state adjustments */
.user-sidebar.collapsed .sidebar-header .logo {
    justify-content: center;
    padding: 0.5rem;
}

.user-sidebar.collapsed .sidebar-header .logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.user-sidebar.collapsed .sidebar-header .logo-icon {
    margin-right: 0;
}

.sidebar-nav {
    padding: 1rem 0.5rem;
    position: relative;
    z-index: 2;
    height: calc(100vh - 120px);
    overflow-y: auto;
}

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

.nav-section:last-child {
    margin-bottom: 0;
}

.nav-section-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    padding: 0 1.25rem;
}

.user-sidebar .nav {
    padding: 0;
}

.user-sidebar .nav-item {
    margin-bottom: 0.5rem;
}

.user-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.75rem 0.5rem;
    border-radius: 0.75rem;
    /* margin: 0.25rem 0.5rem; */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    position: relative;
    font-weight: 500;
    font-size: 0.95rem;
}

.user-sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 0 2px 2px 0;
    transition: height 0.3s ease;
}

.user-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.user-sidebar .nav-link:hover::before {
    height: 60%;
}

.user-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    font-weight: 600;
}

.user-sidebar .nav-link.active::before {
    height: 80%;
}

.user-sidebar .nav-link i {
    width: 24px;
    margin-right: 1rem;
    text-align: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.user-sidebar .nav-link .nav-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-sidebar .nav-link .nav-label {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.user-sidebar .nav-link .nav-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.72rem;
    margin-top: 0.2rem;
}

.user-sidebar .nav-link .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2) !important;
}

.user-sidebar .nav-link:hover i,
.user-sidebar .nav-link.active i {
    transform: scale(1.1);
}

.user-sidebar.collapsed .nav-link span {
    display: none;
}

.user-sidebar.collapsed .nav-link .badge {
    display: none;
}

.user-sidebar.collapsed .nav-link i {
    margin-right: 0;
}

.user-sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 1rem 0.5rem;
}

.user-sidebar.collapsed .nav-section-title {
    display: none;
}

.user-sidebar.collapsed .sidebar-nav {
    padding: 1rem 0.25rem;
}

/* Scrollbar styling for sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.user-main-content {
    margin-left: 280px;
    transition: all 0.3s ease;
    min-height: 100vh;
    background-color: #f8f9fa;
}

.user-main-content.expanded {
    margin-left: 80px;
}

.user-topbar {
    background: white;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
}

.user-content {
    padding: 2rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #495057;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(26, 26, 26, 0.2);
    color: #1a1a1a;
    transform: scale(1.1);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.flow-page-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.flow-meta-label {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: #6c757d;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #404040 0%, #505050 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.flow-summary-pill {
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.05) 0%, rgba(26, 26, 26, 0.15) 100%);
    border: 1px solid rgba(26, 26, 26, 0.08);
    min-width: 230px;
}

.flow-summary-pill .pill-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6c757d;
}

.flow-summary-pill .pill-channels {
    margin-top: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.flow-summary-pill .pill-channels span {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.15);
    color: #4b5aef;
    font-weight: 600;
}

/* Dropdown Styles */
.dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
}

.btn-outline-primary {
    border-width: 2px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.2);
}

.btn-primary {
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.timeline-alt {
    position: relative;
}

.timeline-alt .timeline-item {
    position: relative;
    padding: 1rem 0;
    border-left: 2px solid #e9ecef;
    margin-left: 1rem;
}

.timeline-alt .timeline-item:before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 1.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e9ecef;
}

.timeline-alt .timeline-icon {
    position: absolute;
    left: -0.75rem;
    top: 1.25rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.timeline-alt .timeline-item-info {
    margin-left: 1rem;
}

.card.border {
    transition: all 0.3s ease;
}

.card.border:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.avatar-lg {
    width: 4rem;
    height: 4rem;
}

.avatar-sm {
    width: 2.5rem;
    height: 2.5rem;
}

.avatar-xs {
    width: 2rem;
    height: 2rem;
}

.avatar-title {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.bg-light-primary {
    background-color: rgba(102, 126, 234, 0.1) !important;
}

.bg-light-success {
    background-color: rgba(40, 167, 69, 0.1) !important;
}

.bg-light-info {
    background-color: rgba(23, 162, 184, 0.1) !important;
}

.bg-light-warning {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

.mini-stats-wid .card-body {
    padding: 1.5rem;
}

.mini-stats-wid .mini-stat-icon {
    width: 3rem;
    height: 3rem;
}

.table-centered td {
    vertical-align: middle;
}

.btn-group .btn {
    margin-right: 0.25rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: ">";
    color: #6c757d;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #495057;
}

.breadcrumb-item.active {
    color: #495057;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .navbar-nav .nav-link {
        padding: 12px 16px;
        margin: 2px 0;
    }

    .navbar-nav .btn {
        margin: 8px 0;
        width: 100%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .user-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .user-sidebar.show {
        transform: translateX(0);
    }

    .user-main-content {
        margin-left: 0;
    }

    .user-content {
        padding: 1rem;
    }

    .user-topbar {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .user-sidebar {
        width: 100%;
    }

    .sidebar-header {
        padding: 1.5rem 1rem;
    }

    .sidebar-nav {
        padding: 0.5rem;
    }
}

/* QR Code Display Styles */
.stat-item {
    padding: 10px;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qr-code-display img {
    transition: transform 0.3s ease;
}

.qr-code-display img:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .qr-code-display .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .qr-code-display .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 5px;
    }
}

/* Guest Navigation Styles */
.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: #667eea !important;
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    color: #667eea !important;
    font-weight: 600;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #667eea;
    border-radius: 1px;
}

/* Navigation Animation */
.navbar-nav .nav-item {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.navbar-nav .nav-item:nth-child(1) {
    animation-delay: 0.1s;
}

.navbar-nav .nav-item:nth-child(2) {
    animation-delay: 0.2s;
}

.navbar-nav .nav-item:nth-child(3) {
    animation-delay: 0.3s;
}

.navbar-nav .nav-item:nth-child(4) {
    animation-delay: 0.4s;
}

.navbar-nav .nav-item:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Guest Navigation */
@media (max-width: 991.98px) {
    .navbar-nav {
        padding: 20px 0;
    }

    .navbar-nav .nav-item {
        margin: 5px 0;
    }

    .navbar-nav .nav-link {
        padding: 12px 20px;
        border-radius: 8px;
        margin: 2px 0;
    }

    .navbar-nav .nav-link:hover {
        background: rgba(102, 126, 234, 0.1);
        transform: none;
    }

    .dropdown-menu {
        border: none;
        box-shadow: none;
        background: rgba(102, 126, 234, 0.05);
        margin: 5px 0;
        padding: 5px 0;
    }

    .dropdown-item {
        margin: 2px 15px;
        border-radius: 6px;
    }
}

/* Spinner/Loading Overlay */
#spinner_overlay {
    position: fixed;
    top: 0;
    z-index: 10000;
    width: 100%;
    height: 100%;
    display: none;
    background: rgba(0, 0, 0, 0.6);
}

.cv-spinner {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px #ddd solid;
    border-top: 4px #2e93e6 solid;
    border-radius: 50%;
    animation: sp-anime 0.8s infinite linear;
}

@keyframes sp-anime {
    100% {
        transform: rotate(360deg);
    }
}

.is-hide {
    display: none;
}
