

:root {
    --primary-color: #00235b;
    --secondary-color: #ff0000;
    --text-color: #333;
    --sidebar-width: 250px;
}

/* Layout */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
#sidebar {
    width: var(--sidebar-width);
    background: var(--primary-color);
    color: #fff;
    transition: all 0.3s;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 999;
}

#sidebar.active {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
    padding: 20px;
    text-align: center;
}

.sidebar-header .logo {
    max-width: 120px;
    height: auto;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 12px 20px;
    display: block;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
}

#sidebar ul li a:hover,
#sidebar ul li.active a {
    background: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
}

#sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Content */
#content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    transition: all 0.3s;
}

#content.expanded {
    width: 100%;
    margin-left: 0;
}

/* Navbar */
.navbar {
    padding: 15px;
    background: #fff !important;
    border-bottom: 1px solid #eee;
}

#sidebarCollapse {
    background: transparent;
    border: none;
    padding: 10px;
}

.navbar-brand-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.brand-text {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 1px;
    margin: 0;
    padding: 0 10px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite, slideInDown 0.8s ease-in-out;
    text-shadow: 0 2px 4px rgba(0, 35, 91, 0.1);
    display: inline-block;
}

@keyframes gradientShift {
    0% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
    100% {
        background-position: 0% center;
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.user-avatar-wrapper:hover {
    background-color: rgba(0, 35, 91, 0.08);
}

.user-text-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
}

.avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.2);
    border-color: var(--secondary-color);
}

.username {
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
}

.user-info.show .fa-chevron-down {
    transform: rotate(180deg);
    transition: transform 0.3s;
}

.user-info .fa-chevron-down {
    transition: transform 0.3s;
    color: var(--primary-color);
    font-size: 12px;
}

/* Dashboard Cards */
.stats-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Animated entrance for cards */
.stats-card { animation: cardEnter 560ms ease both; }
.stats-card:hover { transform: translateY(-6px); transition: transform 220ms ease; box-shadow: 0 8px 22px rgba(0,0,0,0.12); }

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Dashboard chart containers */
.chart-card { padding: 16px; border-radius: 8px; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,0.06); }
.chart-card .chart-title { font-weight: 700; color: var(--primary-color); margin-bottom: 8px; }
.chart-container { position: relative; height: 260px; }

/* Table & card header action styles */
.card .card-header { display: flex; align-items: center; justify-content: space-between; }
.card .card-actions .btn { font-size: 13px; padding: 6px 10px; }
.table-hover tbody tr:hover { background: rgba(0,0,0,0.03); }
.table thead th { background: #f8f9fa; }
.card .card-body .table { margin-bottom: 0; }

/* Small responsive tweaks for mobile charts */
@media (max-width: 576px) {
    .chart-container { height: 220px; }
    .stats-card { padding: 16px; }
}

.stats-card h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 24px;
}

.stats-card p {
    margin: 5px 0 0;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    #sidebar.active {
        margin-left: 0;
    }
    #content {
        width: 100%;
        margin-left: 0;
    }
}

/* Mobile-only admin tweaks (moved from layout-be/master.blade.php) */
@media (max-width: 768px) {
    /* Hide long brand text on mobile to avoid overlap */
    .navbar-brand-center .brand-text { display: none !important; }

    /* Ensure main content doesn't underlap the fixed navbar. Use CSS var so JS can override it. */
    #content { --navbar-height: 68px; }

    /* Give stacked buttons some breathing room on small screens */
    .btn { margin-top: 12px; }

    /* On small screens navbar should be full width at left 0 */
    nav.navbar { left: 0 !important; width: 100% !important; }

    /* Sidebar header: show small minimize button on mobile */
    #sidebar .sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    #sidebar .sidebar-header .logo { max-height: 38px; }
    #sidebar .sidebar-header .mobile-minimize { display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: #fff; }

    /* Make sidebar overlay on mobile when active/collapsed */
    .wrapper #sidebar { position: fixed; height: 100vh; left: 0; top: 0; z-index: 1040; }
    .wrapper #content.expanded { margin-left: 0 !important; }

    /* Make admin cards and forms full width and comfortable spacing */
    .container-fluid .card { margin-bottom: 12px; }
    .container-fluid .card .card-body { padding: 12px; }
    .btn { white-space: nowrap; }
}

/* Minor improvement: ensure sidebar toggle button is visible and looks like a control */
#sidebarCollapse.btn { background: transparent; border: none; padding: 6px; }

/* Make navbar fixed at top for desktop and mobile; on desktop offset by sidebar width */
nav.navbar {
    position: fixed;
    top: 0;
    z-index: 1030;
    left: 0;
    width: 100%;
    transition: left 0.25s ease, width 0.25s ease;
}

/* When the content is not expanded (sidebar visible), offset navbar to the right of sidebar */
#content:not(.expanded) > nav.navbar {
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

/* When content is expanded (sidebar hidden) navbar should be full width */
#content.expanded > nav.navbar {
    left: 0;
    width: 100%;
}

/* provide a CSS variable for navbar height (fallback) and use it for main padding
    JS will update `--navbar-height` at runtime so the content never underlaps the fixed navbar */
#content { --navbar-height: 68px; }
#content > main { padding-top: var(--navbar-height); }

/* Consolidated view-specific mobile tweaks (from per-view @push blocks) */
@media (max-width: 768px) {
    /* Product / Slider */
    .form-card { padding: 16px; }
    .image-preview-box { max-width: 100% !important; min-height: 140px; padding: 12px; }
    .image-preview-box.has-image img { object-fit: cover; }
    #imagePreview { max-height: 240px; width: 100%; }
    .image-preview-box.has-image img { max-height: 200px; width: 100%; }

    /* Forms and buttons */
    .form-buttons { flex-direction: column-reverse; gap: 8px; }
    .form-buttons .btn { width: 100%; }
    .section-grid { grid-template-columns: 1fr; }

    /* Phone / option controls */
    .phone-button-group { flex-direction: column; }
    .phone-btn { width: 100%; }

    /* Gallery create specific */
    #images-container .image-row { flex-direction: column; align-items: stretch; gap: 8px; }
    #images-container .image-row input[type="file"] { width: 100%; }
    #images-container .image-row .form-select { width: 100% !important; }
    #add-image-row { width: 100%; display: block; }
    .card .card-body { padding: 12px; }
}

/* Pagination Styling */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.pagination .page-item {
    margin: 0 5px;
}

.pagination .page-link {
    font-size: 14px;
    position: relative;
    display: block;
    padding: 0;
    text-align: center;
    margin-left: -1px;
    line-height: 45px;
    width: 45px;
    height: 45px;
    border-radius: 0 !important;
    color: #8a8a8a;
    border: 1px solid #f0e9ff;
    margin-right: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: #f0e9ff;
    color: #555;
}

.pagination .page-link i,
.pagination .page-link span {
    font-size: 13px;
}

.pagination .page-item.active .page-link {
    background-color: #fbf9ff;
    border-color: #f0e9ff;
    color: #888888;
}

.pagination .page-item:last-child .page-link {
    margin-right: 0;
}

.pagination .page-item.disabled .page-link {
    color: #ccc;
    pointer-events: none;
}