/* Custom Admin Styles for Digimenu */

:root {
    --primary-accent: #FF6D1F; /* Vibrant Orange */
    --base-bg: #FAF3E1;        /* Warm Cream */
    --secondary-bg: #F5E7C6;   /* Soft Sand */
    --text-dark: #222222;      /* Charcoal Black */
    --sidebar-width: 260px;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--base-bg);
    color: var(--text-dark);
    max-width: 100%;
    overflow-x: clip;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Bree Serif', serif;
    font-weight: 400;
}

/* Sidebar Layout */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #ffffff;
    border-right: 1px solid var(--secondary-bg);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--secondary-bg);
}

.sidebar-brand {
    font-size: 1.5rem;
    color: var(--primary-accent);
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-brand:hover {
    color: #e55a10;
}

.nav-link {
    padding: 0.8rem 1.5rem;
    color: #555555;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease-in-out;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--base-bg);
    color: var(--primary-accent);
}

.nav-link i {
    font-size: 1.2rem;
}

/* Main Content Layout */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-nav {
    background-color: #ffffff;
    border-bottom: 1px solid var(--secondary-bg);
    padding: 0.75rem 2rem;
    margin: -2rem -2rem 2rem -2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Cards & Components */
.admin-card {
    background: #ffffff;
    border: 1px solid var(--secondary-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* Menu Builder Styles */
.category-card {
    background: #ffffff;
    border: 1px solid var(--secondary-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

.menu-item-row {
    border-bottom: 1px solid #f3f3f3;
    padding: 1.25rem 0;
    transition: background-color 0.2s;
}

.menu-item-row:hover {
    background-color: #fcfbfa;
}

.menu-item-row:last-child {
    border-bottom: none;
}

.item-photo {
    width: 65px;
    height: 65px;
    background: var(--secondary-bg);
    border-radius: 10px;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888888;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-primary {
    background-color: var(--primary-accent);
    border-color: var(--primary-accent);
    color: #ffffff;
    font-weight: 500;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #e55a10;
    border-color: #e55a10;
    color: #ffffff;
}

.btn-outline-primary {
    color: var(--primary-accent);
    border-color: var(--primary-accent);
}

.btn-outline-primary:hover {
    background-color: var(--primary-accent);
    border-color: var(--primary-accent);
    color: #ffffff;
}

.btn-outline-dark {
    border-color: var(--text-dark);
    color: var(--text-dark);
}

.btn-outline-dark:hover {
    background-color: var(--text-dark);
    color: #ffffff;
}

/* Switch Styles */
.form-check-input:checked {
    background-color: var(--primary-accent);
    border-color: var(--primary-accent);
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .sidebar {
        left: calc(-1 * var(--sidebar-width));
    }
    .main-content {
        margin-left: 0;
        padding: 1.25rem;
    }
    .sidebar.active {
        left: 0;
    }
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
        z-index: 999;
        display: none;
    }
    .sidebar-overlay.active {
        display: block;
    }
    .top-nav {
        padding: 0.75rem 1.25rem;
        margin: -1.25rem -1.25rem 1.5rem -1.25rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    .top-nav {
        padding: 0.75rem 1rem;
        margin: -1rem -1rem 1.25rem -1rem;
    }
}

@media (max-width: 576px) {
    .top-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .top-nav > div {
        width: 100%;
    }
    .top-nav .ms-auto {
        margin-left: 0 !important;
        justify-content: space-between;
    }
    
    /* Responsive Input Group for narrow screens */
    .input-group.responsive-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    .input-group.responsive-input-group .input-group-text {
        border-radius: 0.375rem 0.375rem 0 0 !important;
        border-bottom: none;
        text-align: left;
        justify-content: flex-start;
    }
    .input-group.responsive-input-group .form-control {
        border-radius: 0 0 0.375rem 0.375rem !important;
        width: 100% !important;
    }
}

.menu-url-text {
    display: inline-block;
    max-width: 220px;
}
@media (max-width: 992px) {
    .menu-url-text {
        max-width: 150px;
    }
}
@media (max-width: 576px) {
    .menu-url-text {
        max-width: 120px;
    }
}

/* Floating Alerts */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060;
}

.floating-alert {
    min-width: 280px;
    background: white;
    border-left: 4px solid var(--primary-accent);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 12px 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease-out;
    pointer-events: auto;
}

.floating-alert.alert-warning {
    border-left-color: #ffc107;
}

.floating-alert.alert-danger {
    border-left-color: #dc3545;
}

.floating-alert.alert-success {
    border-left-color: #198754;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Page Specific Mockup Styles */

/* Billing Page */
.plan-card {
    background: #ffffff;
    border: 1px solid var(--secondary-bg);
    border-radius: 12px;
    padding: 2rem;
}

/* Orders Page */
.table-card {
    background: #ffffff;
    border: 1px solid var(--secondary-bg);
    border-radius: 12px;
    padding: 1rem;
    scrollbar-gutter: stable;
}

/* QR Code Page */
.qr-preview {
    background: #ffffff;
    border: 1px solid var(--secondary-bg);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}
.qr-placeholder {
    width: 250px;
    height: 250px;
    background: #eeeeee;
    margin: 0 auto 1.5rem;
    border: 1px solid #dddddd;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.qr-placeholder::after {
    content: 'QR CODE';
    font-weight: bold;
    color: #999999;
}

/* Profile Page */
.profile-photo-preview {
    width: 150px;
    height: 150px;
    background-color: var(--secondary-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 2px dashed #cccccc;
}

/* Display Mode Previews in Profile */
.mode-preview-container {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 15px;
    margin-top: 10px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mini-preview {
    width: 100%;
    max-width: 280px;
    height: 120px;
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.mini-header {
    height: 30px;
    background: var(--primary-accent);
    opacity: 0.8;
}
.mini-item {
    height: 10px;
    background: #eeeeee;
    margin-bottom: 5px;
    border-radius: 2px;
}
.mini-circle {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #eeeeee;
    position: absolute;
}
.preview-classic .mini-header {
    height: 40px;
    position: relative;
}
.preview-classic .mini-circle {
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
}
.preview-classic .mini-sidebar {
    width: 25%;
    height: 100%;
    border-right: 1px solid #f0f0f0;
    padding: 5px;
}
.preview-classic .mini-content {
    width: 75%;
    padding: 5px;
}
.preview-tabs .mini-header {
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.preview-tabs .mini-circle {
    width: 10px;
    height: 10px;
    position: static;
}
.preview-tabs .mini-nav {
    display: flex;
    gap: 4px;
    padding: 5px;
    justify-content: center;
    border-bottom: 1px solid #f0f0f0;
}
.preview-tabs .mini-pill {
    height: 8px;
    width: 30px;
    background: var(--primary-accent);
    border-radius: 4px;
    opacity: 0.2;
}
.preview-tabs .mini-pill.active {
    opacity: 1;
}
.preview-grid .mini-header-plain {
    height: 15px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 5px;
}
.preview-grid .mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 5px;
}
.preview-grid .mini-card {
    height: 35px;
    background: #f9f9f9;
    border-radius: 2px;
}
.preview-grid .mini-img {
    height: 20px;
    background: #eeeeee;
}
.preview-minimalist {
    padding: 10px;
}
.preview-minimalist .mini-title {
    height: 8px;
    width: 50%;
    background: var(--primary-accent);
    margin: 0 auto 10px auto;
}
.preview-minimalist .mini-line {
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 8px;
}

/* Menu URL Badge styles in Top Nav */
.menu-url-container {
    transition: all 0.2s ease-in-out;
}
.menu-url-container:hover {
    border-color: var(--primary-accent) !important;
    box-shadow: 0 2px 8px rgba(255, 109, 31, 0.15) !important;
}
.menu-url-container .hover-primary {
    transition: color 0.15s ease-in-out;
}
.menu-url-container .hover-primary:hover {
    color: var(--primary-accent) !important;
}

/* Public Menu Status Styling in Top Nav */
.menu-status-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.85rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 50px; /* Capsule shape */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    height: 38px;
}

.menu-status-card:hover {
    border-color: #ced4da;
    background-color: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.menu-status-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
}

/* Glowing animation for active state */
.glowing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #198754;
    box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7);
    animation: status-pulse-green 1.8s infinite;
}

.offline-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #dc3545;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    animation: status-pulse-red 1.8s infinite;
}

@keyframes status-pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(25, 135, 84, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
    }
}

@keyframes status-pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(220, 53, 69, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Custom Tooltip */
.tooltip-custom-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tooltip-custom-text {
    visibility: hidden;
    width: 260px;
    background-color: #212529;
    color: #ffffff;
    border-radius: 8px;
    padding: 10px 14px;
    position: absolute;
    z-index: 1100;
    bottom: 130%; /* Position above the icon */
    right: -10px; /* Align slightly to the right */
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
    font-size: 0.75rem;
    font-family: 'Poppins', sans-serif;
    font-weight: normal;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-custom-text::after {
    content: "";
    position: absolute;
    top: 100%; /* At the bottom of tooltip */
    right: 15px; /* Arrow position corresponding to the icon */
    border-width: 6px;
    border-style: solid;
    border-color: #212529 transparent transparent transparent;
}

.tooltip-custom-container:hover .tooltip-custom-text {
    visibility: visible;
    opacity: 1;
}

