/* Mobile Styles for Bibliana Web */

/* Menu Toggle Button */
.menu-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    display: none;
    transition: background-color 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Mobile Menu Sidebar */
.mobile-menu-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: var(--card-background-color);
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu-sidebar.open {
    left: 0;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.sidebar-header .logo-text h1 {
    font-size: 1.3rem;
    color: white;
    margin-bottom: 0.2rem;
}

.sidebar-header .logo-text p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

.close-menu {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.close-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

.close-menu svg {
    width: 20px;
    height: 20px;
}

/* Mobile Navigation */
.mobile-nav {
    padding: 1rem 0;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav li {
    margin: 0;
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.mobile-nav a:hover {
    background: var(--light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.mobile-nav a.active {
    background: var(--light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.mobile-nav .nav-icon {
    width: 20px;
    height: 20px;
}

/* Header Responsive Adjustments */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
    }

    .header-container {
        padding: 1rem !important;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
    }

    .header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .logo-container {
        display: flex;
        align-items: center;
        gap: 0.8rem;
    }

    .logo-text h1 {
        font-size: 1.4rem !important;
        margin-bottom: 0.1rem;
    }

    .logo-text p {
        font-size: 0.75rem !important;
        letter-spacing: 0.5px;
    }

    /* Adjust main content padding for mobile */
    .main-container {
        padding: 1.5rem 1rem !important;
        margin: 1rem auto !important;
    }

    /* Content titles responsive */
    .content-title {
        font-size: 2rem !important;
        margin-bottom: 0.8rem;
    }

    .content-subtitle {
        font-size: 1rem !important;
        margin-bottom: 2rem;
    }

    /* Cards responsive */
    .playlists-grid,
    .plans-grid,
    .estudos-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    /* Stats responsive */
    .playlist-stats,
    .plan-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.8rem;
    }

    /* Buttons responsive */
    .plan-actions,
    .playlist-actions {
        flex-direction: column;
        gap: 0.8rem;
    }

    .filter-buttons {
        gap: 0.5rem;
        justify-content: center;
        margin-bottom: 2rem;
    }

    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    /* Header height adjustment */
    .main-header {
        padding: 0;
    }

    /* Carousel adjustments for mobile */
    .carousel-container {
        margin: 2rem 0;
        padding: 0;
    }

    .carousel-header {
        padding: 0 1rem;
        margin-bottom: 1.5rem;
    }

    .carousel-title {
        font-size: 1.8rem !important;
    }

    .carousel-track {
        padding: 0 1rem;
        gap: 1rem;
    }

    .carousel-card {
        min-width: 280px;
        max-width: 300px;
    }

    /* Footer adjustments */
    .main-footer {
        padding: 1.5rem 1rem;
        margin-top: 2rem;
    }
}

@media (max-width: 480px) {
    .logo-text h1 {
        font-size: 1.2rem !important;
    }

    .logo-text p {
        font-size: 0.7rem !important;
    }

    .content-title {
        font-size: 1.8rem !important;
    }

    .main-container {
        padding: 1rem !important;
    }

    /* Single column for all stats on very small screens */
    .playlist-stats,
    .plan-stats {
        grid-template-columns: 1fr !important;
    }

    /* Reduce card padding */
    .playlist-card,
    .plan-card,
    .estudo-card {
        margin-bottom: 1rem;
    }

    .playlist-body,
    .plan-body {
        padding: 1.2rem !important;
    }

    .playlist-header,
    .plan-header {
        padding: 1.2rem !important;
    }

    /* Smaller filter buttons */
    .filter-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    /* Adjust carousel for very small screens */
    .carousel-card {
        min-width: 260px;
        max-width: 280px;
    }

    .carousel-title {
        font-size: 1.6rem !important;
    }

    /* Smaller content sections */
    .content-header {
        margin-bottom: 2rem;
    }

    .playlists-section,
    .plans-section {
        margin-bottom: 2rem;
    }
}

/* Dark mode adjustments for mobile elements */
body.dark-mode .mobile-menu-sidebar {
    background: var(--card-background-color);
}

body.dark-mode .mobile-nav a {
    color: var(--text);
}

body.dark-mode .mobile-nav a:hover,
body.dark-mode .mobile-nav a.active {
    background: var(--light);
    color: var(--primary);
}

/* Ensure proper stacking */
.mobile-menu-overlay,
.mobile-menu-sidebar {
    z-index: 9999;
}

.main-header {
    z-index: 100;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Touch-friendly sizing */
@media (max-width: 768px) {
    .plan-btn,
    .playlist-button,
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .reading-btn,
    .filter-btn {
        min-height: 40px;
    }

    /* Better touch targets for interactive elements */
    .theme-toggle-btn {
        padding: 0.8rem;
        min-width: 44px;
        min-height: 44px;
    }

    /* Improve form elements on mobile */
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.8rem;
        border-radius: 8px;
    }

    /* Better spacing for mobile */
    .section-title {
        font-size: 1.6rem !important;
        margin-bottom: 1rem;
    }

    .section-subtitle {
        font-size: 0.95rem !important;
        margin-bottom: 1.5rem;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .main-container {
        padding: 1rem !important;
    }

    .content-title {
        font-size: 1.8rem !important;
    }

    .carousel-container {
        margin: 1.5rem 0;
    }
}

/* Very small screens (older phones) */
@media (max-width: 360px) {
    .logo-text h1 {
        font-size: 1.1rem !important;
    }

    .logo-text p {
        font-size: 0.65rem !important;
    }

    .content-title {
        font-size: 1.6rem !important;
    }

    .carousel-card {
        min-width: 240px;
        max-width: 260px;
    }

    .mobile-menu-sidebar {
        width: 260px;
        left: -260px;
    }

    .filter-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
}

