/* Global Layout */
body {
    overflow: hidden; /* Prevent body scroll, let main content scroll */
    background-color: #f0f2f5;
}

/* Sidebar Styles */
.sidebar {
    transition: all 0.3s;
    background-color: #ffffff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    z-index: 100;
}

/* Beautiful Modern Buttons (Shape & Display only) */
.list-group-item {
    border: 1px solid #e0e0e0; /* Visible border for button definition */
    border-radius: 12px !important; /* Force consistent rounded corners */
    margin-bottom: 12px;
    color: #495057;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: #ffffff; /* White background */
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.1); /* Explicit card shadow */
    letter-spacing: normal;
    cursor: pointer;
}

/* Override Bootstrap's default list-group-item corner handling */
.list-group-item:first-child {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}

.list-group-item:last-child {
    border-bottom-left-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
}

.list-group-item i {
    font-size: 1.2rem;
    margin-right: 0;
    transition: none;
}

/* Icon Wrapper Default State */
.list-group-item .icon-wrapper {
    background-color: #f1f3f5; /* Light gray background for icon */
    color: #6c757d; /* Muted icon color */
    transition: all 0.3s ease;
}

/* Hover State - Make it pop */
.list-group-item:hover {
    background: #ffffff;
    color: #0d6efd;
    transform: translateY(-4px); /* Lift higher */
    border-color: #0d6efd; /* Brand border on hover */
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.15); /* Colored shadow */
}

.list-group-item:hover .icon-wrapper {
    background-color: #e7f1ff !important;
    color: #0d6efd !important;
}

/* Active State - Selected */
.list-group-item.active {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3);
}

.list-group-item.active .icon-wrapper {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.list-group-item.active .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.list-group-item.active .arrow-icon {
    color: white !important;
    opacity: 1 !important;
}

/* QR Code Styling */
.qr-container {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    /* Option 1: Double border style */
    outline: 4px solid rgba(255, 255, 255, 0.5);
    background: #ffffff;
}

.qr-container:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15) !important;
    border-color: #0d6efd; /* Brand color border on hover */
}

/* Action Panel Container */
.action-panel {
    width: auto; /* Allow auto width */
    min-width: 200px; /* Minimum reasonable width */
}

/* Action Panel Buttons */
.action-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.05);
    width: 100%; /* Fill the container */
    display: flex;
    align-items: center;
    justify-content: center; /* Center content horizontally */
    padding: 12px 16px;
    min-height: auto;
    text-align: left; /* Keep text left aligned relative to icon */
}

.action-btn i {
    margin-right: 12px !important; /* Consistent icon spacing */
    font-size: 1.4rem !important; /* Slightly smaller icon */
}

.action-btn .fw-bold {
    font-size: 0.95rem; /* Adjusted title size */
    margin-bottom: 2px;
}

.action-btn .small {
    font-size: 0.75rem; /* Adjusted desc size */
    line-height: 1.2;
}

/* Action Panel Group Spacing */
.action-group {
    gap: 12px !important; /* Reduced gap between buttons */
}

.action-btn:hover {
    background-color: #f8f9fa; /* Lighter hover bg */
    color: #0d6efd;
    transform: translateY(-2px);
    border-color: rgba(13, 110, 253, 0.2); /* Highlight border on hover */
    box-shadow: 0 8px 16px rgba(13, 110, 253, 0.1); /* Colored shadow */
    cursor: pointer;
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
main {
    position: relative;
    overflow: hidden;
    background-color: transparent; /* Changed from #fdfbfb to show clouds */
    padding: 20px;
    transition: all 0.5s ease; /* Smooth main transition */
}

/* Optional: Subtle hover effect on main area to focus user */
main:hover {
    transform: scale(1.01); /* Increased scale for better visibility */
    box-shadow: 0 20px 50px rgba(0,0,0,0.1); /* Add shadow on hover */
    z-index: 2; /* Bring forward */
}

/* Click Ripple Effect for Main Container */
main:active {
    transform: scale(0.998); /* Micro-press interaction */
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0; /* Background layer */
    background: linear-gradient(to bottom, #1E90FF, #87CEFA); /* Fallback gradient */
    transition: opacity 0.5s ease;
}

.content-container {
    position: relative;
    z-index: 1; /* Above particles */
    width: 100%;
    height: 100%;
    justify-content: center; /* Center content horizontally */
}

.iframe-wrapper {
    /* Remove default full width to allow flex sizing */
    width: auto;
    height: 100%;
    overflow-y: visible; /* Let bezel handle overflow */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Mobile Simulator Style for PC */
.phone-bezel {
    position: relative;
    width: auto; /* Width auto to respect aspect ratio */
    height: 80vh; /* Set height relative to viewport */
    max-height: 844px; /* iPhone 12 Pro height */
    aspect-ratio: 390 / 844; /* Fixed Aspect Ratio */
    background: #1a1a1a; /* Dark bezel color */
    border-radius: 40px;
    padding: 12px; /* Bezel thickness */
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.3), /* Deep shadow */
        inset 0 0 10px rgba(255,255,255,0.1); /* Inner gloss */
    margin: auto;
    display: flex;
    flex-direction: column;
}

/* Notch / Top Bar Decoration */
.phone-bezel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 25px;
    background: #1a1a1a;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 10;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
    border-radius: 30px; /* Screen corner radius */
    display: block;
}

/* Loading Spinner */
#loading {
    z-index: 1050;
    width: 3rem;
    height: 3rem;
}

/* Hover Link Effect for Footer */
.hover-link:hover {
    color: #0d6efd !important;
    text-decoration: underline !important;
}

/* Action Panel */
/* Redefined above with button styles */
/* .action-panel {
    min-width: 260px;
    max-width: 260px;
} */

/* Removed redundant .action-btn definitions to avoid conflicts and maintain clean CSS structure */

/* QR Code Container Hover Effect */
.qr-container:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    /* On mobile devices, remove the simulation frame and fill screen */
    
    body {
        overflow: auto; /* Allow scrolling on mobile if needed */
        margin: 0;
        padding: 0;
    }

    /* Hide the entire nav bar on mobile, but keep the menu button */
    nav.navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 0;
        background-color: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0;
        margin: 0;
        z-index: 1050;
    }
    
    nav.navbar .container-fluid {
        position: relative;
        padding: 0;
        height: 0;
    }
    
    /* Hide logo and text on mobile */
    nav.navbar .navbar-brand {
        display: none !important;
    }
    
    /* Style the menu button as a floating button */
    nav.navbar .navbar-toggler {
        position: fixed;
        bottom: 150px;
        left: 20px;
        z-index: 1060;
        background: linear-gradient(135deg, rgba(13, 110, 253, 0.98), rgba(10, 88, 202, 0.98)) !important;
        border: none !important;
        border-radius: 50% !important;
        width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 25px rgba(13, 110, 253, 0.45) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        padding: 0;
        cursor: pointer;
        overflow: hidden;
        backdrop-filter: blur(10px);
    }
    
    nav.navbar .navbar-toggler:hover {
        transform: scale(1.1) translateY(-2px);
        background: linear-gradient(135deg, rgba(13, 110, 253, 1), rgba(10, 88, 202, 1)) !important;
        box-shadow: 0 10px 30px rgba(13, 110, 253, 0.6) !important;
    }
    
    nav.navbar .navbar-toggler:active {
        transform: scale(0.95);
    }
    
    /* Show menu text on mobile */
    nav.navbar .navbar-toggler .menu-text {
        display: inline-block !important;
        color: white;
        font-size: 15px;
        font-weight: 600;
        margin-left: 8px;
        font-family: 'Arial', sans-serif;
        letter-spacing: 0.5px;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }
    
    /* Replace navbar-toggler-icon with a custom icon */
    nav.navbar .navbar-toggler .navbar-toggler-icon {
        display: none;
    }
    
    /* Add custom menu icon */
    nav.navbar .navbar-toggler::before {
        content: "";
        display: inline-block;
        width: 26px;
        height: 2.5px;
        background-color: white;
        border-radius: 1.25px;
        box-shadow: 
            0 -9px 0 white,
            0 9px 0 white;
        transition: all 0.3s ease;
        transform-origin: center;
    }
    
    /* Change icon when sidebar is open */
    nav.navbar .navbar-toggler[aria-expanded="true"]::before {
        transform: rotate(45deg);
        box-shadow: 
            0 0 0 white,
            0 0 0 white;
    }
    
    nav.navbar .navbar-toggler[aria-expanded="true"]::after {
        content: "";
        position: absolute;
        width: 26px;
        height: 2.5px;
        background-color: white;
        border-radius: 1.25px;
        transform: rotate(-45deg);
        transition: all 0.3s ease;
        transform-origin: center;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1050;
        height: 100%;
        width: 280px !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    
    .sidebar.show {
        left: 0;
    }

    main {
        padding: 0;
        height: 100vh;
        margin-top: 0 !important;
    }

    /* Main Content Area */
    .container-fluid.flex-grow-1.d-flex.p-0.overflow-hidden.position-relative {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .iframe-wrapper {
        display: block;
        width: 100%;
        height: 100%;
    }

    .phone-bezel {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        aspect-ratio: unset !important;
        background: none;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
    }
    
    .phone-bezel::before {
        display: none; /* Hide notch on real mobile */
    }

    iframe {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    /* Hide Footer on Mobile */
    .footer {
        display: none !important;
    }
}
