/* ====================== FOOTER STYLES ====================== */
footer {
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--card-border);
    margin-top: auto;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-logo i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* ====================== RESPONSIVIDADE COMPLETA BIPCHAT ====================== */



.mobile-only { display: none !important; }
.desktop-only { display: flex !important; }
.tablet-only { display: none !important; }


.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.4);
    transition: all 0.3s ease;
}

.left-toggle { left: 20px; }
.right-toggle { right: 20px; }

.sidebar-toggle:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(106, 17, 203, 0.6);
}


.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    backdrop-filter: blur(5px);
}

/* ====================== MOBILE (max 768px) ====================== */
@media (max-width: 768px) {
    .mobile-only { display: flex !important; }
    .desktop-only { display: none !important; }
    .tablet-only { display: none !important; }

    .header-container {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.5rem 1rem;
      position: relative;
  }

  .header-left { /* Brand + Balance */
      display: flex;
      align-items: center;
      gap: 0.5rem;
  }

    .nav-3d {
        order: 3;
        width: 100%;
        margin-top: 1rem;
        display: none;
    }
    
    .nav-3d.mobile-visible {
        display: block;
    }
    
    .nav-3d ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-link {
        justify-content: center;
        padding: 1rem;
        border-radius: 12px;
        background: var(--card-bg);
        margin-bottom: 0.5rem;
    }


    .app-container {
        flex-direction: column !important;
        height: 100vh !important;
        padding: 0 !important;
        gap: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

   
    .center-column {
        flex: 1 !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }

  
    .left-column,
    .right-column {
        position: fixed !important;
        top: 0;
        height: 100vh !important;
        width: 85% !important;
        max-width: 300px;
        z-index: 999;
        background: var(--bg-primary);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .right-column {
        left: auto;
        right: 0;
        transform: translateX(100%);
    }

    .left-column.mobile-visible {
        transform: translateX(0);
    }

    .right-column.mobile-visible {
        transform: translateX(0);
    }


    .chat-container {
        max-height: 100vh !important;
        height: 100vh !important;
    }

    .chat-body {
        height: calc(100vh - 140px) !important;
        padding: 0.5rem;
    }

    .chat-footer {
        padding: 0.75rem;
        min-height: 70px;
        border-radius: 0;
    }

    .message-input-container {
        padding: 0.6rem 1rem;
    }

    .send-btn {
        width: 45px;
        height: 45px;
    }

  
    .message-content {
        max-width: 85% !important;
    }

    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    /* Footer mobile */
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem 0;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }


    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-overlay.active {
        display: block;
    }

  
    #rooms.active .center-column,
    #shop.active .center-column,
    #profile.active .center-column {
        padding: 1rem;
        height: 100vh;
        overflow-y: auto;
    }

    .shop-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .rooms-grid {
        gap: 0.75rem;
    }

    .room-card {
        padding: 1rem;
    }

    /* Profile mobile */
    .profile-header {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .profile-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .profile-sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .profile-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* ====================== TABLET (769px - 1024px) ====================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .mobile-only { display: none !important; }
    .desktop-only { display: flex !important; }
    .tablet-only { display: flex !important; }


    .app-container {
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .left-column,
    .right-column {
        flex: 0 0 200px;
    }

    .center-column {
        flex: 1;
    }

 
    .participants-container {
        height: calc(100vh - 140px);
    }

    .chat-body {
        height: calc(100vh - 160px);
    }

    .message-content {
        max-width: 70%;
    }

    /* Header tablet */
    .header-container {
        padding: 0.75rem 1rem;
    }

    .nav-3d ul {
        gap: 1rem;
    }

    /* Shop grid tablet */
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    /* Profile tablet */
    .profile-header {
        grid-template-columns: auto 1fr;
        gap: 1.5rem;
        padding: 2rem;
    }

    .profile-stats {
        gap: 1.5rem;
    }
}

/* ====================== DESKTOP (above  1024px) ====================== */
@media (min-width: 1025px) {
    .mobile-only { display: none !important; }
    .desktop-only { display: flex !important; }
    .tablet-only { display: none !important; }


    .app-container {
        gap: 1rem;
        padding: 1rem;
        max-width: 1400px;
        margin: 0 auto;
    }

    .left-column,
    .right-column {
        flex: 0 0 235px;
        display: flex !important;
    }

    .center-column {
        flex: 1;
    }


    .chat-container {
        max-height: 86vh;
    }

    .chat-body {
        height: calc(100vh - 180px);
    }

    .message-content {
        max-width: 75%;
    }


    .header-container {
        padding: 0.5rem 1rem;
    }

    .nav-3d ul {
        gap: 1.5rem;
    }

    /* Shop grid desktop */
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    /* Profile desktop */
    .profile-header {
        grid-template-columns: auto 1fr auto;
        gap: 2rem;
        padding: 2.5rem;
    }

    .profile-stats {
        gap: 2rem;
    }

    .profile-sections {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .profile-actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* ====================== big screens (above 1440px) ====================== */
@media (min-width: 1441px) {
    .app-container {
        max-width: 1600px;
    }

    .left-column,
    .right-column {
        flex: 0 0 280px;
    }

    .center-column {
        flex: 1;
    }
}


@media (max-width: 768px) and (orientation: landscape) {
    .chat-body {
        height: calc(100vh - 120px) !important;
    }

    .chat-footer {
        min-height: 60px;
        padding: 0.5rem;
    }

    .message-input-container {
        padding: 0.5rem 0.8rem;
    }

    .left-column,
    .right-column {
        width: 70% !important;
    }
}


.sidebar-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-scale {
    transition: transform 0.3s ease;
}

.mobile-visible ~ .center-column {
    transform: scale(0.95);
    opacity: 0.8;
}


@media (prefers-reduced-motion: reduce) {
    .sidebar-transition,
    .chat-scale,
    .message {
        transition: none !important;
        animation: none !important;
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    .left-column,
    .right-column {
        border: 2px solid var(--text-primary);
    }
    
    .sidebar-toggle {
        border: 2px solid white;
    }
}

/* Dark mode adjustments */
[data-theme="dark"] .mobile-overlay {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .left-column,
[data-theme="dark"] .right-column {
    background: var(--bg-secondary);
}

/* ====================== UTILITÁRIOS FINAIS ====================== */
.no-scroll {
    overflow: hidden !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


@supports(padding: max(0px)) {
    .app-container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .chat-footer {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

#mobile-nav-toggle {
    display: none;
}


@media (max-width: 768px) {


    .header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 1rem;
        gap: 0.75rem; 
    }

    .header-left { /* Brand + Balance */
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .theme-toggle {
        display: flex;
        margin-left: 0.5rem;
    }

    .logout-btn {
        display: none; 
    }


    #mobile-nav-toggle {
        display: flex;
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 1001;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: var(--secondary-gradient); 
        color: white;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

  
    .nav-3d {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        transform: translateX(-110%);
        transition: transform 0.3s ease;
        position: absolute;
        top: 100%; 
        right: 0;
        background: var(--bg-primary);
        padding: 0.5rem 1rem;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        z-index: 1000;
    }

    
    .nav-3d.mobile-visible {
        transform: translateX(0);
    }
}