/* Frontend Styles */

:root {
    --sidebar-width: 280px;
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f8f9fa;
    --sidebar-active: #000000;
    --topbar-height: 70px;
    --transition-speed: 0.3s;
    --icon-primary: #667eea;
    --icon-secondary: #f093fb;
    --icon-success: #4facfe;
    --icon-warning: #f093fb;
    --icon-danger: #fa709a;
    --icon-info: #30cfd0;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: #000000;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform var(--transition-speed) ease;
    overflow-y: auto;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
    border-left: 1px solid #e9ecef;
}

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

.sidebar-header {
    padding: 1.5rem;
    background: #000000;
    border-bottom: 2px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-brand {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand i {
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--icon-primary) 0%, var(--icon-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    margin: 0.25rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #333333;
    text-decoration: none;
    transition: all var(--transition-speed);
    border-right: 3px solid transparent;
    position: relative;
    font-weight: 500;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #000000;
    padding-right: 2rem;
    transform: translateX(-5px);
}

.sidebar-link:hover i {
    transform: scale(1.2) rotate(5deg);
}

.sidebar-link.active {
    background: #f8f9fa;
    color: #000000;
    border-right-color: var(--sidebar-active);
    font-weight: 600;
}

.sidebar-link.active i {
    transform: scale(1.15);
}

.sidebar-link i {
    font-size: 1.35rem;
    width: 28px;
    text-align: center;
    transition: all 0.3s ease;
    display: inline-block;
}

/* Icon Colors - Magic Touch */
.sidebar-link[href="/"] i,
.sidebar-link[href="/"]:hover i {
    color: var(--icon-primary);
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.sidebar-link[href*="/products"] i,
.sidebar-link[href*="/products"]:hover i {
    color: var(--icon-success);
    text-shadow: 0 0 10px rgba(79, 172, 254, 0.3);
}

.sidebar-link[href*="/about"] i,
.sidebar-link[href*="/about"]:hover i {
    color: var(--icon-info);
    text-shadow: 0 0 10px rgba(48, 207, 208, 0.3);
}

.sidebar-link[href*="/contact"] i,
.sidebar-link[href*="/contact"]:hover i {
    color: var(--icon-warning);
    text-shadow: 0 0 10px rgba(240, 147, 251, 0.3);
}

.sidebar-link[href*="/dashboard"] i,
.sidebar-link[href*="/dashboard"]:hover i {
    color: var(--icon-primary);
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.sidebar-link[href*="/devices"] i,
.sidebar-link[href*="/devices"]:hover i {
    color: var(--icon-success);
    text-shadow: 0 0 10px rgba(79, 172, 254, 0.3);
}

.sidebar-link[href*="/login"] i,
.sidebar-link[href*="/login"]:hover i {
    color: var(--icon-info);
    text-shadow: 0 0 10px rgba(48, 207, 208, 0.3);
}

.sidebar-link[href*="/logout"] i,
.sidebar-link[href*="/logout"]:hover i {
    color: var(--icon-danger);
    text-shadow: 0 0 10px rgba(250, 112, 154, 0.3);
}

.sidebar-link[href*="/privacy"] i,
.sidebar-link[href*="/privacy"]:hover i {
    color: var(--icon-info);
    text-shadow: 0 0 10px rgba(48, 207, 208, 0.3);
}

.sidebar-link[href*="/terms"] i,
.sidebar-link[href*="/terms"]:hover i {
    color: var(--icon-success);
    text-shadow: 0 0 10px rgba(79, 172, 254, 0.3);
}

.sidebar-link[href*="/news"] i,
.sidebar-link[href*="/news"]:hover i {
    color: var(--icon-warning);
    text-shadow: 0 0 10px rgba(240, 147, 251, 0.3);
}

.sidebar-link-primary {
    background: linear-gradient(135deg, var(--icon-primary) 0%, var(--icon-secondary) 100%);
    color: white !important;
    margin: 0.5rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.sidebar-link-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #e084f0 100%);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.sidebar-link-primary i {
    color: white !important;
    text-shadow: none;
}

.sidebar-divider {
    height: 1px;
    background: #e9ecef;
    margin: 1rem 1.5rem;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
}

.user-avatar {
    width: 45px;
    height: 45px;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--icon-primary) 0%, var(--icon-secondary) 100%) !important;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed), visibility var(--transition-speed);
}

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

/* Top Bar */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    z-index: 1030;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.topbar-brand {
    color: #000000;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.topbar-brand:hover {
    color: #000000;
    transform: scale(1.05);
}

.topbar-brand i {
    background: linear-gradient(135deg, var(--icon-primary) 0%, var(--icon-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.75rem;
    animation: iconPulse 2s ease-in-out infinite;
}

#openSidebar {
    color: #000000;
    transition: all 0.3s ease;
}

#openSidebar:hover {
    color: var(--icon-primary);
    transform: scale(1.1);
}

#openSidebar i {
    transition: transform 0.3s ease;
}

#openSidebar:hover i {
    transform: rotate(90deg);
}

/* Mobile Circular Logo */
.mobile-logo {
    display: inline-block;
    text-decoration: none;
    margin-right: 0;
}

.logo-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--icon-primary) 0%, var(--icon-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    animation: logoPulse 2s ease-in-out infinite;
    padding: 2px;
    overflow: hidden;
}

.logo-circle img {
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.logo-circle i {
    color: white;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.mobile-logo:hover .logo-circle {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.mobile-logo:hover .logo-circle img {
    transform: scale(1.1) rotate(5deg);
}

.mobile-logo:hover .logo-circle i {
    transform: rotate(10deg);
}

@keyframes logoPulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }

    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    }
}

/* Hide mobile logo on desktop */
@media (min-width: 768px) {
    .mobile-logo {
        display: none !important;
    }
}

/* Main Content */
.main-content {
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
    position: relative;
    overflow-x: hidden;
}

/* Animated Grid Network Background */
body {
    position: relative;
    background: #ffffff;
    overflow-x: hidden;
}

/* Grid Network Container */
.grid-network {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background: #ffffff;
}

/* Grid Pattern */
.grid-network::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle, rgba(102, 126, 234, 0.15) 1px, transparent 1px),
        radial-gradient(circle, rgba(118, 75, 162, 0.1) 1px, transparent 1px);
    background-size: 50px 50px, 100px 100px;
    background-position: 0 0, 25px 25px;
    animation: gridMove 20s linear infinite;
    opacity: 0.6;
}

/* Animated Grid Lines */
.grid-network::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(102, 126, 234, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 15s linear infinite reverse;
    opacity: 0.4;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* Animated Network Nodes */
.network-node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6), rgba(118, 75, 162, 0.6));
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
    animation: nodePulse 3s ease-in-out infinite;
}

/* Network Connections (Lines between nodes) */
.network-connection {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(102, 126, 234, 0.3),
            rgba(118, 75, 162, 0.3),
            transparent);
    transform-origin: left center;
    animation: connectionFlow 4s ease-in-out infinite;
}

/* Node Pulse Animation */
@keyframes nodePulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
        box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
    }

    50% {
        transform: scale(1.3);
        opacity: 1;
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
    }
}

/* Connection Flow Animation */
@keyframes connectionFlow {
    0% {
        opacity: 0.2;
        transform: scaleX(0.8);
    }

    50% {
        opacity: 0.6;
        transform: scaleX(1);
    }

    100% {
        opacity: 0.2;
        transform: scaleX(0.8);
    }
}

/* Generate Network Nodes Dynamically */
.network-node:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.network-node:nth-child(2) {
    top: 20%;
    left: 30%;
    animation-delay: 0.5s;
}

.network-node:nth-child(3) {
    top: 15%;
    left: 50%;
    animation-delay: 1s;
}

.network-node:nth-child(4) {
    top: 25%;
    left: 70%;
    animation-delay: 1.5s;
}

.network-node:nth-child(5) {
    top: 10%;
    left: 85%;
    animation-delay: 2s;
}

.network-node:nth-child(6) {
    top: 40%;
    left: 15%;
    animation-delay: 0.3s;
}

.network-node:nth-child(7) {
    top: 50%;
    left: 35%;
    animation-delay: 0.8s;
}

.network-node:nth-child(8) {
    top: 45%;
    left: 55%;
    animation-delay: 1.3s;
}

.network-node:nth-child(9) {
    top: 55%;
    left: 75%;
    animation-delay: 1.8s;
}

.network-node:nth-child(10) {
    top: 40%;
    left: 90%;
    animation-delay: 2.3s;
}

.network-node:nth-child(11) {
    top: 70%;
    left: 20%;
    animation-delay: 0.6s;
}

.network-node:nth-child(12) {
    top: 80%;
    left: 40%;
    animation-delay: 1.1s;
}

.network-node:nth-child(13) {
    top: 75%;
    left: 60%;
    animation-delay: 1.6s;
}

.network-node:nth-child(14) {
    top: 85%;
    left: 80%;
    animation-delay: 2.1s;
}

.network-node:nth-child(15) {
    top: 70%;
    left: 95%;
    animation-delay: 2.6s;
}

/* Responsive adjustments for grid network */
@media (max-width: 768px) {
    .grid-network::before {
        background-size: 30px 30px, 60px 60px;
    }

    .grid-network::after {
        background-size: 30px 30px;
    }

    .network-node {
        width: 6px;
        height: 6px;
    }
}

/* Responsive Styles */
@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none !important;
    }

    .main-content {
        margin-right: var(--sidebar-width);
    }

    #closeSidebar {
        display: none;
    }

    .topbar {
        right: var(--sidebar-width);
    }
}

/* Desktop Mode - Icons Only */
@media (min-width: 1200px) {
    .sidebar {
        width: 80px;
    }

    .sidebar-brand .brand-text {
        display: none;
    }

    .sidebar-link span {
        display: none;
    }

    .sidebar-link {
        justify-content: center;
        padding: 1rem;
    }

    .sidebar-link i {
        font-size: 1.5rem;
        width: auto;
    }

    .sidebar-link-primary {
        margin: 0.5rem;
        padding: 1rem;
        text-align: center;
    }

    .sidebar-link-primary span {
        display: none;
    }

    .sidebar-divider {
        margin: 1rem 0.5rem;
    }

    .sidebar-footer {
        padding: 1rem 0.5rem;
    }

    .sidebar-user-info {
        text-align: center;
    }

    .sidebar-user-info .d-flex {
        flex-direction: column;
        align-items: center;
    }

    .sidebar-user-info .user-avatar {
        margin: 0 0 0.5rem 0;
    }

    .sidebar-user-info>div {
        display: none;
    }

    .sidebar-user-info>p {
        display: none;
    }

    .main-content {
        margin-right: 80px;
    }

    .topbar {
        right: 80px;
    }

    .sidebar-header {
        padding: 1rem;
        text-align: center;
    }

    .sidebar-brand {
        justify-content: center;
    }
}

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

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

    .main-content {
        margin-right: 0;
    }

    .topbar {
        right: 0;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 6rem 0;
    margin-top: var(--topbar-height);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.5rem;
    opacity: 0.9;
}

.hero-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Feature Cards */
.feature-icon {
    margin-bottom: 1rem;
}

.step-number {
    margin-bottom: 1.5rem;
}

/* Product Cards */
.product-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Icon Box */
.icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--icon-primary) 0%, var(--icon-secondary) 100%);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #e084f0 100%);
}

/* Smooth Transitions */
* {
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Alert Messages */
.alert {
    margin-top: calc(var(--topbar-height) + 1rem);
}

/* Footer */
footer {
    margin-top: 3rem;
}