/* ===============================
   DEVICE LAYOUT - Responsive Design
   Desktop (1200px+), Tablet (768px-1199px), Mobile (<768px)
=================================== */

/* Base Device Layout Classes */
.device-layout {
    width: 100%;
    min-height: 100vh;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

/* ===============================
   DESKTOP DEVICES (1200px and above)
=================================== */

@media (min-width: 1200px) {
    /* Desktop Navigation */
    .desktop-nav {
        display: block !important;
    }

    /* Desktop-specific content wrapper */
    .device-content {
        width: 100%;
    }

    .device-wrapper {
        margin: 0 auto;
    }

    .desktop-wrapper {
        display: block;
    }

    /* Desktop Top Bar */
    .top-bar {
        height: 70px;
    }

    .nav-wrapper {
        max-width: 1400px;
        margin: 0 auto;
        padding: 10px 40px;
    }

    /* Desktop Branding */
    .branding {
        gap: 15px;
    }

    .logo {
        height: 50px;
    }

    .navbar-title {
        font-size: 24px;
    }

    /* Desktop Nav Links */
    .main-nav ul {
        gap: 35px;
    }

    .main-nav a {
        font-size: 16px;
        padding: 8px 0;
    }

    /* Desktop Profile Section */
    .d-flex.align-items-center.gap-3 {
        gap: 25px !important;
    }

    /* Hide mobile-trigger on desktop */
    .mobile-trigger {
        display: none !important;
    }

    /* Desktop Chat Widget */
    .chat-widget {
        bottom: 30px;
        right: 30px;
    }

    .chat-container {
        width: 380px;
        height: 500px;
    }

    /* Desktop Notifications */
    .notifications-dropdown {
        width: 380px !important;
        max-height: 450px !important;
    }

    /* Desktop Modal */
    .modal-dialog {
        max-width: 500px;
    }

    /* Show desktop-specific elements */
    .desktop-only {
        display: block;
    }

    .tablet-only,
    .mobile-only {
        display: none !important;
    }
}

/* ===============================
   TABLET DEVICES (768px to 1199px)
=================================== */

@media (min-width: 768px) and (max-width: 1199px) {
    /* Tablet Navigation */
    .desktop-nav {
        display: flex !important;
    }

    /* Tablet-specific content wrapper */
    .device-content {
        margin-top: 70px;
        width: 100%;
    }

    .device-wrapper {
        max-width: 100%;
        margin: 0 auto;
        padding: 15px 25px;
    }

    .desktop-wrapper {
        display: block;
    }

    /* Tablet Top Bar */
    .top-bar {
        height: 70px;
    }

    .nav-wrapper {
        padding: 10px 25px;
    }

    /* Tablet Branding */
    .branding {
        gap: 10px;
    }

    .logo {
        height: 45px;
    }

    .navbar-title {
        font-size: 20px;
    }

    /* Tablet Nav Links */
    .main-nav ul {
        gap: 20px;
    }

    .main-nav a {
        font-size: 14px;
        padding: 6px 0;
    }

    /* Tablet Profile Section */
    .d-flex.align-items-center.gap-3 {
        gap: 15px !important;
    }

    /* Show hamburger on tablet */
    .mobile-trigger {
        display: flex !important;
    }

    /* Tablet Chat Widget */
    .chat-widget {
        bottom: 25px;
        right: 25px;
    }

    .chat-container {
        width: 340px;
        height: 450px;
    }

    /* Tablet Notifications */
    .notifications-dropdown {
        width: 300px !important;
        max-height: 400px !important;
    }

    /* Tablet Modal */
    .modal-dialog {
        max-width: 450px;
    }

    /* Show tablet-specific elements */
    .tablet-only {
        display: block;
    }

    .desktop-only,
    .mobile-only {
        display: none !important;
    }
}

/* ===============================
   MOBILE DEVICES (below 768px)
=================================== */
.mobile-top-bar{
    width: 100%;
}


@media (max-width: 767px) {
    /* Hide desktop nav on mobile */
    .desktop-nav {
        display: none !important;
    }

    /* Mobile-specific content wrapper */
    .device-content {
        width: 100%;
    }

    .device-wrapper {
        width: 100%;
        margin: 0;
    }

    .desktop-wrapper {
        display: block;
    }

    /* Mobile Top Bar */
    .top-bar {
        height: 65px;
    }

    .nav-wrapper {
        padding: 8px 15px;
        min-height: 65px;
    }

    /* Mobile Branding */
    .branding {
        gap: 8px;
    }

    .logo {
        height: 35px;
    }

    .navbar-title {
        font-size: 14px;
    }

    /* Mobile Profile Section */
    .d-flex.align-items-center.gap-3 {
        gap: 10px !important;
    }

    /* Show hamburger on mobile */
    .mobile-trigger {
        display: flex !important;
    }

    /* Mobile Chat Widget */
    .chat-widget {
        bottom: 15px;
        right: 15px;
    }

    .chat-container {
        width: calc(100vw - 30px);
        max-width: 320px;
        height: 400px;
    }

    /* Mobile Notifications */
    .notifications-dropdown {
        width: 280px !important;
        max-height: 350px !important;
        right: -50px !important;
    }

    /* Mobile Modal */
    .modal-dialog {
        max-width: 350px;
        margin: 10px auto;
    }

    /* Hide desktop-only elements on mobile */
    .desktop-only {
        display: none !important;
    }

    .tablet-only {
        display: none !important;
    }

    .mobile-only {
        display: block;
    }
}

/* ===============================
   TOP BAR (Common Styles)
=================================== */

section {
    scroll-margin-top: 90px;
}

/* =============================
   DEVICE-SPECIFIC TOP BAR STYLES
================================= */

/* Desktop Top Bar (lg and above) */
.top-bar.d-none.d-lg-block {
    height: 70px;
}

.top-bar.d-none.d-lg-block .nav-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 40px;
}

/* Tablet Top Bar (md only, 768px-991px) */
.top-bar.d-none.d-md-block.d-lg-none {
    height: 70px;
}

.top-bar.d-none.d-md-block.d-lg-none .nav-wrapper {
    max-width: 100%;
    padding: 10px 25px;
}

/* Mobile Top Bar (below 768px) */
.top-bar.d-block.d-md-none {
    height: 65px;
}

.top-bar.d-block.d-md-none .nav-wrapper {
    padding: 8px 15px;
    min-height: 65px;
}

/* Content margin adjustments for each device */
@media (min-width: 992px) {
    .content {
        margin-top: 70px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        padding: 0;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .content {
        margin-top: 70px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        padding: 0;
    }
}

@media (max-width: 767px) {
    .content {
        margin-top: 65px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        padding: 0;
    }
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    z-index: 1000;
}

/* Fix dropdown divider for mobile */
.dropdown-divider {
    margin: 0.5rem 0;
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
}

@media (max-width: 767px) {
    .dropdown-divider {
        margin: 0.25rem 0;
    }
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

/* Branding */
.branding {
    display: flex;
    align-items: center;
}

.logo {
    object-fit: contain;
}

.navbar-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    margin: 0;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Desktop Nav */
.main-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: #000000;
    text-decoration: none;
    transition: 0.3s;
    position: relative;
}

.main-nav a.active {
    color: #000000;
    font-weight: 700;
}

.mobile-nav-link.active {
    color: #3B00FF;
    font-weight: 600;
}

/* Buttons */
.get-started-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.get-started-btn:hover {
    background: #0056b3;
}

.get-started-btn.dropdown-toggle::after {
    display: none !important;
}

/* ===============================
   HAMBURGER
=================================== */

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: #333;
    transition: 0.3s;
}

/* Animation */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===============================
   MOBILE MENU
=================================== */

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 998;
}

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

.mobile-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: min(280px, calc(100vw - 24px));
    height: 100vh;
    background: #fff;
    transition: right 0.35s ease;
    z-index: 999;
    padding-top: 20px;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.close-menu {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    display: block;
    text-align: right;
    padding: 10px 20px;
    width: 100%;
}

.mobile-nav-list {
    list-style: none;
    padding: 5px 10px;
    margin: 0;
}

.mobile-nav-link {
    display: block;
    padding: 5px 10px;
    color: #000000;
    text-decoration: none;
    transition: 0.3s;
}

.mobile-nav-link:hover {
    background: #f5f5f5;
    color: #000000;
}

.mobile-nav-link.active {
    background: #f0f0ff;
    color: #3B00FF;
    font-weight: 700;
    border-left: 4px solid #3B00FF;
}

.get-started-btn-mobile {
    width: 90%;
    margin: 15px auto;
    display: block;
    background: #007bff;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    text-decoration: none;
    text-align: center;
}

.get-started-btn-mobile:hover {
    background: #0056b3;
}

.get-started-btn-mobile.text-danger:hover {
    background: #dc3545;
}

/* ===============================
   RESPONSIVE (Legacy Support)
=================================== */

@media (max-width: 768px) {

    .main-nav,
    .get-started-btn {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .navbar-title {
        font-size: 16px;
    }

    .content {
        margin-top: 75px;
        padding: 15px;
        width: 100%;
    }
}

@media (min-width: 769px) {

    .mobile-menu,
    .menu-overlay {
        display: none;
    }

    .content {
        width: 100%;
    }
}

.content,
.device-content,
.device-wrapper,
.desktop-wrapper {
    max-width: 100%;
}

.device-content .container,
.device-content .container-fluid,
.device-content .row {
    max-width: 100%;
}

.dropdown-menu {
    max-width: min(22rem, calc(100vw - 24px));
}

.notifications-dropdown {
    max-width: min(22rem, calc(100vw - 24px)) !important;
}

.app-notification-dropdown {
    display: inline-flex;
    align-items: center;
}

.app-notification-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    line-height: 1;
    overflow: visible;
}

.app-notification-badge {
    position: absolute;
    top: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    min-width: 1.8rem;
    height: 1.4rem;
    padding: 0 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.28);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 100%;
}

.chat-widget,
.chat-container {
    max-width: calc(100vw - 24px);
}

@media (max-width: 991px) {
    .top-bar .d-flex.align-items-center.gap-3 {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

@media (max-width: 767px) {
    .nav-wrapper {
        flex-wrap: nowrap;
    }

    .branding {
        min-width: 0;
        flex: 1 1 auto;
    }

    .navbar-title {
        font-size: 13px;
    }

    .content {
        padding-left: 0;
        padding-right: 0;
    }

    .mobile-menu {
        right: calc(-1 * min(280px, calc(100vw - 24px)));
    }

    .chat-widget {
        left: auto;
    }

    .chat-container {
        width: min(320px, calc(100vw - 24px));
    }

    .modal-dialog {
        max-width: calc(100vw - 24px);
        margin: 12px auto;
    }
}

/* ===============================
   DEVICE-SPECIFIC UTILITY CLASSES
=================================== */

/* Visibility utilities */
.show-desktop {
    display: none;
}

.show-tablet {
    display: none;
}

.show-mobile {
    display: none;
}

@media (min-width: 1200px) {
    .show-desktop {
        display: block;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .show-tablet {
        display: block;
    }
}

@media (max-width: 767px) {
    .show-mobile {
        display: block;
    }
}

/* Hide utilities */
.hide-desktop {
    display: block;
}

.hide-tablet {
    display: block;
}

.hide-mobile {
    display: block;
}

@media (min-width: 1200px) {
    .hide-desktop {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .hide-tablet {
        display: none;
    }
}

@media (max-width: 767px) {
    .hide-mobile {
        display: none;
    }
}

/* ===============================
   CHAT SUPPORT WIDGET
=================================== */

.chat-widget {
    position: fixed;
    z-index: 1001;
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #007bff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s;
}

.chat-button:hover {
    transform: scale(1.1);
}

.chat-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.chat-container {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-container.active {
    display: flex;
}

.chat-header {
    background: #007bff;
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header .avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header .avatar svg {
    width: 24px;
    height: 24px;
    fill: #007bff;
}

.chat-header .info h3 {
    margin: 0;
    font-size: 16px;
}

.chat-header .info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chat-header .close-chat {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.chat-header .close-chat svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    min-height: 200px;
}

.message {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 80%;
    font-size: 14px;
}

.message.bot {
    background: #f0f0f0;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.message.user {
    background: #007bff;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message .time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
}

.typing-indicator {
    display: none;
    padding: 10px 15px;
}

.typing-indicator.active {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.chat-input {
    padding: 12px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

.chat-input input:focus {
    border-color: #007bff;
}

.chat-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007bff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.chat-input button:hover {
    background: #0056b3;
}

.chat-input button svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* ===============================
   ORDER SUCCESS MODAL
=================================== */

.modal-content {
    border: none;
    border-radius: 12px;
}

.modal-header {
    padding: 15px 20px 0;
}

.modal-body {
    padding: 20px;
}

/* Register-specific styles moved to public/css/auth.css */
