/* =============================================================================
   JobDash Digital - Navegação Mobile
   Menu Hamburger e Drawer Lateral
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Menu Hamburger Button
   ----------------------------------------------------------------------------- */
.mobile-menu-button {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    z-index: var(--z-fixed);
    transition: var(--transition-fast);
    align-items: center;
    justify-content: center;
}

.mobile-menu-button:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.mobile-menu-button:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Hamburger Icon */
.hamburger {
    position: relative;
    width: 24px;
    height: 20px;
}

.hamburger span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-fast);
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger span:nth-child(3) {
    bottom: 0;
}

/* Hamburger Animation */
.mobile-menu-button.active .hamburger span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

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

.mobile-menu-button.active .hamburger span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* -----------------------------------------------------------------------------
   Mobile Navigation Drawer
   ----------------------------------------------------------------------------- */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    transition: opacity var(--transition-normal);
    backdrop-filter: blur(4px);
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    background: var(--bg-secondary);
    z-index: var(--z-modal);
    transition: transform var(--transition-normal) ease-out;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.mobile-nav-drawer.active {
    transform: translateX(-100%);
}

/* Drawer Header */
.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-nav-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.mobile-nav-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Drawer Menu Items */
.mobile-nav-menu {
    padding: 1rem 0;
}

.mobile-nav-item {
    display: block;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
    font-size: 1rem;
}

.mobile-nav-item:hover {
    background: var(--bg-primary);
    border-left-color: var(--accent);
    color: var(--accent);
}

.mobile-nav-item.active {
    background: var(--bg-primary);
    border-left-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.mobile-nav-item i {
    width: 24px;
    margin-right: 0.75rem;
    text-align: center;
}

/* Drawer Divider */
.mobile-nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

/* Drawer User Section */
.mobile-nav-user {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.mobile-nav-user-info {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.mobile-nav-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin-right: 0.75rem;
}

.mobile-nav-user-details {
    flex: 1;
}

.mobile-nav-user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.mobile-nav-user-role {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* -----------------------------------------------------------------------------
   Desktop Footer Control
   ----------------------------------------------------------------------------- */
.desktop-footer {
    display: block;
}

@media (max-width: 639px) {
    .desktop-footer {
        display: none !important;
    }
}

/* -----------------------------------------------------------------------------
   Mobile Bottom Navigation (Alternative)
   ----------------------------------------------------------------------------- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: var(--z-fixed);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 56px;
    padding: 0 0.5rem;
}

.mobile-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    padding: 0.5rem;
    min-width: 60px;
    font-size: 0.75rem;
}

.mobile-bottom-nav-item:hover,
.mobile-bottom-nav-item.active {
    color: var(--accent);
}

.mobile-bottom-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.mobile-bottom-nav-item span {
    display: block;
    white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   Mobile Search Bar
   ----------------------------------------------------------------------------- */
.mobile-search-container {
    display: none;
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.mobile-search-form {
    position: relative;
}

.mobile-search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 1rem;
}

.mobile-search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.mobile-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* -----------------------------------------------------------------------------
   Mobile Fab Button (Floating Action Button)
   ----------------------------------------------------------------------------- */
.mobile-fab {
    display: none;
    position: fixed;
    bottom: 5rem; /* Acima do bottom nav */
    right: 1.5rem;
    width: 56px;
    height: 56px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    z-index: calc(var(--z-fixed) + 1); /* Acima do bottom nav */
    cursor: pointer;
    transition: var(--transition-normal);
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
}

.mobile-fab:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.5);
}

.mobile-fab i {
    font-size: 1.5rem;
}

/* Ajuste para telas maiores (tablet) sem bottom nav */
@media (min-width: 640px) and (max-width: 1023px) {
    .mobile-fab {
        bottom: 1.5rem;
    }
}

/* -----------------------------------------------------------------------------
   Responsive Navbar Adjustments
   ----------------------------------------------------------------------------- */
@media (max-width: 1023px) {
    /* Esconder navbar desktop */
    .navbar {
        display: none !important;
    }

    /* Mostrar elementos mobile */
    .mobile-menu-button {
        display: flex;
    }

    .mobile-search-container {
        display: block;
    }

    /* Ajustar padding do conteúdo principal */
    .main-content {
        padding-top: 4rem;
    }
}

@media (max-width: 639px) {
    /* Ativar bottom navigation em mobile pequeno */
    .mobile-bottom-nav {
        display: block;
    }

    /* Ajustar padding do conteúdo para bottom nav + espaço extra */
    .container {
        padding-bottom: 80px !important;
    }

    /* Ajustar main-content também */
    .main-content {
        padding-bottom: 80px !important;
    }

    /* Mostrar FAB em mobile */
    .mobile-fab {
        display: flex;
    }
}

/* -----------------------------------------------------------------------------
   Mobile-First Typography Adjustments
   ----------------------------------------------------------------------------- */
@media (max-width: 639px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.125rem;
    }

    .page-title {
        font-size: 1.5rem;
    }
}

/* -----------------------------------------------------------------------------
   Mobile Animations
   ----------------------------------------------------------------------------- */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* -----------------------------------------------------------------------------
   Swipe Gestures Indicator
   ----------------------------------------------------------------------------- */
.swipe-indicator {
    display: none;
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60px;
    background: var(--accent);
    border-radius: 2px;
    opacity: 0.5;
}

@media (max-width: 1023px) {
    .mobile-nav-drawer .swipe-indicator {
        display: block;
    }
}

/* -----------------------------------------------------------------------------
   Accessibility for Mobile
   ----------------------------------------------------------------------------- */
@media (pointer: coarse) {
    /* Aumentar área de toque em dispositivos touch */
    button,
    a,
    .clickable {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Espaçamento entre elementos interativos */
    .button-group button + button,
    .link-list a + a {
        margin-left: 8px;
    }
}

/* -----------------------------------------------------------------------------
   iOS Specific Styles
   ----------------------------------------------------------------------------- */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    .mobile-nav-drawer {
        -webkit-overflow-scrolling: touch;
    }

    /* Safe area for iPhone X+ */
    .mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-fab {
        bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }

    .has-bottom-nav .mobile-fab {
        bottom: calc(5rem + env(safe-area-inset-bottom));
    }
}

/* -----------------------------------------------------------------------------
   Android Specific Styles
   ----------------------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .mobile-nav-item:hover {
        background: transparent;
    }

    /* Use active state instead */
    .mobile-nav-item:active {
        background: var(--bg-primary);
        border-left-color: var(--accent);
    }
}