:root {
    --grey-bg: #f0f0f3;
    --card-bg: #ffffff;
    --accent: #000000;
    --success: #28a745;
    --error: #dc3545;
    --text: #333;
    --muted: #777;
}

* {
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
}

body {
    margin: 0;
    background: var(--grey-bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===============================
   MAIN LAYOUT
   =============================== */
main {
    flex: 1;
    padding: 1rem;
    max-width: 420px;
    margin: 0 auto;
}

/* Ensure space so nav never overlaps Load More */
main,
#ordersContainer {
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

/* ===============================
   CARDS & FORM ELEMENTS
   =============================== */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.center { text-align: center; }



button.primary {
    background: var(--accent);
    border: none;
    color: white;
    font-weight: 600;
}

/* ===============================
   TOAST
   =============================== */
.toast {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    animation: fadeOut 3s forwards;
    z-index: 2000;
}

.toast.show { display: block; }

@keyframes fadeOut {
    0% {opacity:1;}
    80% {opacity:1;}
    100% {opacity:0;display:none;}
}

/* ===============================
   BOTTOM NAVIGATION BAR
   =============================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 70px;
    margin: 0 auto;
    background: #000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -3px 15px rgba(0, 0, 0, 0.6);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom); /* iOS safe area support */
}

.bottom-nav button {
    background: none;
    border: none;
    color: #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    gap: 4px;
    transition: color 0.25s ease, opacity 0.25s ease, text-shadow 0.25s ease;
    position: relative;
    flex: 1;
}

.bottom-nav button img {
    width: 22px;
    height: 22px;
    filter: invert(1);
    opacity: 0.8;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.bottom-nav button:hover,
.bottom-nav button.active {
    color: #fff;
}

.bottom-nav button:hover img,
.bottom-nav button.active img {
    opacity: 1;
    transform: scale(1.05);
}

.bottom-nav button span {
    color: #ccc;
    transition: color 0.25s ease;
}

.bottom-nav button:hover span,
.bottom-nav button.active span {
    color: #fff;
    font-weight: 600;
}

/* Active Glow Indicator */
.bottom-nav button.active::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(255,255,255,0.8);
}

.glyphicon-large {
    font-size: 2em;
}

.glyphicon-medium {
    font-size: 1em;
}

/* ===============================
   ORDER CARDS / TOGGLE
   =============================== */
.trade-toggle {
    display: flex;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}

/* Align toggle text beside switch */
.toggle-text {
    display: flex;
    align-items: center;
}

/* ===============================
   LOADER & BUTTONS
   =============================== */
#loadingIndicator {
    padding: 10px;
    font-weight: 600;
    color: #777;
    text-align: center;
}

#loadMoreBtn {
    margin: 10px auto;
    display: block;
    width: 90%;
    max-width: 250px;

    transition: background 0.25s ease, color 0.25s ease;
}

#loadMoreBtn:hover {
    background: var(--accent);
    color: #fff;
}
#chatMessages {
    max-height: 400px;  /* adjust height as needed */
    overflow-y: auto;
    padding: 10px;
    border-radius: 6px;
    scroll-behavior: smooth;
}

/* ===============================
   THREE DOT MENU (adapted to theme)
   =============================== */

.three-dot-menu {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 26px;
    height: 26px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-btn:hover {
    transform: scale(1.1);
}

/* Dots */
.menu-btn .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #ccc;
    opacity: 0.9;
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.menu-btn:hover .dot {
    background-color: #fff;
    transform: scale(1.2);
}

/* Tooltip on hover (styled for black nav) */
.menu-btn::after {
    content: attr(title);
    position: absolute;
    bottom: 38px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.1);
}



/* Dropdown List */
.dropdown-content {
    display: none;
    position: absolute;
    bottom: 45px;
    right: 0;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    min-width: 200px;
    padding: 8px 0;
    list-style: none;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.25s ease;
    z-index: 999;
}

.dropdown-content.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-content li {
    padding: 10px 15px;
}

.dropdown-content li a {
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    display: block;
    transition: background 0.2s ease, color 0.2s ease;
}


/* === DARK DROPDOWN STYLE === */
.dark-dropdown {
    color: #fff;
    background: #1c1c1e;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    padding: 4px 0;
    min-width: 220px;
}

.dark-dropdown li {
    list-style: none;
}

.dark-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.25s ease;
    border-radius: 6px;
}

/* Hover */
.dark-dropdown a:hover {
    background-color: #2a2a2d;
    color: #fff;
    transform: translateY(-1px);
}

/* Active / subscribed look */
.dark-dropdown a.active-bell {
    background-color: #153f2e;
    color: #4cd964;
    box-shadow: 0 0 0 1px rgba(76, 217, 100, 0.3);
    animation: pulseGlow 2s infinite;
}

.dark-dropdown a.active-bell:hover {
    background-color: #1b4f38;
    color: #57e075;
    transform: translateY(-1px);
}

/* Glow animation */
@keyframes pulseGlow {
    0%   { box-shadow: 0 0 0 0 rgba(76, 217, 100, 0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(76, 217, 100, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 217, 100, 0); }
}
.notif-danger { background-color: #ffe5e5; border-left: 4px solid #dc3545; }
.notif-warning { background-color: #fff3cd; border-left: 4px solid #ffc107; }
.notif-info { background-color: #e7f3ff; border-left: 4px solid #007bff; }
.notif-default { background-color: #f8f9fa; border-left: 4px solid #adb5bd; }