/* Mobile-first responsive design */

/* Large screens - desktops */
@media (max-width: 1200px) {
   
    button {
        font-size: smaller;
    }

    .menu-item {
        font-size: smaller;
    }
    
    .base-menu {
        white-space: nowrap;
    }
    
    /* Optimize language selector for large screens */
    .language-select {
        margin-left: 1rem; /* Reduce margin to prevent overflow */
    }
}

/* Intermediate screens - optimize spacing for horizontal layout */
@media (max-width: 1200px) and (min-width: 992px) {
    /* Allow natural horizontal layout for navbar */
    #navbarNav {
        flex-direction: row !important;
    }
    
    /* Ensure the navbar nav takes available space */
    .navbar-nav {
        flex: 1;
    }
    
    /* Optimize button container spacing */
    #navbarNav .d-flex {
        flex-shrink: 0;
        margin-left: 0.5rem;
    }
    
    /* Reduce language select margin to prevent overflow */
    .language-select {
        margin-left: 0.25rem;
        margin-right: 0.25rem;
    }
    
    /* Ensure menu items don't wrap */
    .navbar-nav .nav-item {
        white-space: nowrap;
    }
    
    /* Optimize language selector width */
    .form-select-sm {
        min-width: 90px;
        max-width: 120px;
    }
}

/* Medium screens - tablets */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 18px !important;
    }
    
    .carousel-caption h4 {
        font-size: 1.1rem;
    }
    
    .carousel-caption p {
        font-size: 0.9rem;
    }
    
    .index-subtitle {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    /* Responsive uncategorized warning text for tablets */
    .uncategorized-warning h5 {
        font-size: 1.1rem !important;
    }
    
    /* Responsive free trial banner text for tablets */
    .free-trial h4 {
        font-size: 1.3rem !important;
    }
    
    .free-trial h5 {
        font-size: 1.1rem !important;
    }
    
    .free-trial span {
        font-size: 1.0rem !important;
    }
    
    /* Responsive uncategorized title text for tablets (Categories page) */
    .uncategorized-title {
        font-size: 1.2rem !important;
    }
    
    /* Improve language selector for tablet view */
    .language-select {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
    
    /* Better language dropdown width management */
    .form-select-sm {
        min-width: 100px;
        max-width: 140px;
        font-size: 0.85rem;
    }
    
    /* Better text overflow handling for menu items */
    .base-menu {
        font-size: 0.9rem;
        text-overflow: ellipsis;
        overflow: hidden;
    }
    
    /* Improve dropdown menu items */
    .dropdown-item.base-menu {
        font-size: 0.85rem;
        white-space: normal;
        word-wrap: break-word;
        padding: 0.5rem 1rem;
    }
}

/* Small screens - mobile phones */
@media (max-width: 576px) {
    .navbar-brand {
        font-size: 16px !important;
    }
    
    .carousel-caption {
        padding: 1rem 0.5rem;
    }
    
    .carousel-caption h4 {
        font-size: 1rem;
    }
    
    .carousel-caption p {
        font-size: 0.8rem;
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .index-subtitle {
        font-size: 1.3rem;
    }
    
    .card-header h6 {
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Responsive uncategorized warning text for mobile */
    .uncategorized-warning h5 {
        font-size: 0.75rem !important;
        line-height: 1.3;
    }
    
    /* Responsive uncategorized warning instruction text for mobile */
    .uncategorized-warning div {
        font-size: 0.65rem !important;
        line-height: 1.3;
    }
    
    /* Responsive free trial banner text for mobile */
    .free-trial h4 {
        font-size: 1.1rem !important;
        line-height: 1.3;
    }
    
    .free-trial h5 {
        font-size: 0.95rem !important;
        line-height: 1.3;
    }
    
    .free-trial span {
        font-size: 0.85rem !important;
        line-height: 1.3;
    }
    
    /* Responsive uncategorized title text for mobile (Categories page) */
    .uncategorized-title {
        font-size: 0.8rem !important;
        line-height: 1.3;
    }
    
    /* Stack feature cards on mobile */
    .d-flex.flex-wrap > .card {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Enhanced modern mobile navbar improvements */
    .language-select {
        padding: 0.75rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin: 0;
        background-color: transparent;
        border-radius: 0.375rem;
        margin-bottom: 0.5rem;
    }
    
    .language-select .nav-link {
        padding: 0;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
        font-weight: 500;
    }
    
    .form-select-sm {
        width: 100%;
        max-width: 100%;
        font-size: 0.875rem;
        padding: 0.375rem 2rem 0.375rem 0.75rem;
    }
    
    /* Modern mobile navbar branding */
    .navbar-brand {
        font-size: 16px !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    /* Improved dropdown items for mobile - inherits collapsed navbar styles */
    .dropdown-item.base-menu {
        font-size: 0.8rem;
        padding: 0.6rem 1.5rem;
        white-space: normal;
        line-height: 1.4;
    }
}

/* Modern Collapsed navbar styles - applies to all screen sizes where navbar is collapsed */
@media (max-width: 991px) {
    /* Modern collapsed navbar background */
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(10px);
        border-radius: 0.5rem;
        margin-top: 1rem;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    /* Optimize menu items in collapsed navbar */
    .navbar-collapse .nav-item {
        padding: 0.25rem 0;
        margin: 0.25rem 0;
    }
    
    .navbar-collapse .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: 0.375rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.3s ease;
    }
    
    .navbar-collapse .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.2);
        transform: translateX(5px);
    }
    
    /* Modern dropdown in collapsed navbar */
    .navbar-collapse .dropdown-menu {
        background: rgba(255, 255, 255, 0.1);
        border: none;
        box-shadow: none;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        overflow: hidden;
    }
    
    .navbar-collapse .dropdown-item {
        color: rgba(255, 255, 255, 0.95);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-collapse .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }
    
    /* CRITICAL FIX: Stack buttons vertically in collapsed navbar */
    .navbar-collapse .d-flex {
        flex-direction: column !important;
        gap: 0.75rem;
        padding: 1rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        margin-top: 1rem;
    }
    
    .navbar-collapse .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Modern language selector in collapsed state */
    .navbar-collapse .form-select {
        width: 100%;
        margin: 0;
        background-color: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.5);
        color: #ffffff;
    }
    
    .language-select {
        margin-left: 0.25rem;
        margin-right: 0.25rem;
    }
    
    /* Better dropdown item spacing in collapsed menu */
    .dropdown-item.base-menu {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Intermediate screens - between tablet and mobile */
@media (max-width: 992px) and (min-width: 577px) {
    /* Optimize language selector for intermediate sizes to prevent overflow */
    .language-select {
        margin-left: 0.5rem;
        margin-right: 0.25rem;
    }
    
    .form-select-sm {
        min-width: 110px;
        max-width: 150px;
        font-size: 0.85rem;
    }
    
    /* Prevent text wrapping issues */
    .base-menu {
        font-size: 0.95rem;
    }
    
    /* Better dropdown handling */
    .dropdown-item.base-menu {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* Ensure buttons don't cause overflow at intermediate sizes */
    .navbar-nav {
        flex-wrap: nowrap;
    }
    
    /* Optimize navbar brand size for intermediate screens */
    .navbar-brand {
        font-size: 20px !important;
    }
    
    /* Responsive uncategorized warning text for intermediate screens */
    .uncategorized-warning h5 {
        font-size: 0.95rem !important;
    }
    
    /* Responsive uncategorized warning instruction text for intermediate screens */
    .uncategorized-warning div {
        font-size: 0.85rem !important;
    }
    
    /* Responsive free trial banner text for intermediate screens */
    .free-trial h4 {
        font-size: 1.25rem !important;
    }
    
    .free-trial h5 {
        font-size: 1.05rem !important;
    }
    
    .free-trial span {
        font-size: 0.95rem !important;
    }
    
    /* Responsive uncategorized title text for intermediate screens (Categories page) */
    .uncategorized-title {
        font-size: 1.05rem !important;
    }
}

/* Extra small screens */
@media (max-width: 375px) {
    .carousel-caption h4 {
        font-size: 0.9rem;
    }
    
    .carousel-caption p {
        font-size: 0.75rem;
        -webkit-line-clamp: 3;
    }
    
    .index-subtitle {
        font-size: 1.1rem;
    }
    
    .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Responsive uncategorized warning text for extra small screens */
    .uncategorized-warning h5 {
        font-size: 0.95rem !important;
        line-height: 1.2;
    }
    
    /* Responsive uncategorized warning instruction text for extra small screens */
    .uncategorized-warning div {
        font-size: 0.85rem !important;
        line-height: 1.2;
    }
    
    /* Responsive free trial banner text for extra small screens */
    .free-trial h4 {
        font-size: 1.0rem !important;
        line-height: 1.2;
    }
    
    .free-trial h5 {
        font-size: 0.85rem !important;
        line-height: 1.2;
    }
    
    .free-trial span {
        font-size: 0.75rem !important;
        line-height: 1.2;
    }
    
    /* Responsive uncategorized title text for extra small screens (Categories page) */
    .uncategorized-title {
        font-size: 0.8rem !important;
        line-height: 1.2;
    }
}

/* Footer responsive styles */
/* Default footer logo size for larger screens (desktop)
   Note: .footer-text base font-size (14px) is defined in master.css */
.footer-logo {
    max-width: 200px;
    height: auto;
}

/* Medium screens - tablets */
@media (max-width: 768px) {
    .footer-logo {
        max-width: 150px;
    }
    
    .footer-text {
        font-size: 12px;
    }
    
    footer .lead {
        font-size: 1rem;
    }
}

/* Small screens - mobile phones */
@media (max-width: 576px) {
    .footer-logo {
        max-width: 120px;
    }
    
    .footer-text {
        font-size: 11px;
    }
    
    footer .lead {
        font-size: 0.9rem;
    }
    
    /* Make footer content stack better on mobile */
    footer .d-flex.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    footer .footer-logo-container {
        margin-bottom: 0.5rem;
    }
}

/* Extra small screens */
@media (max-width: 375px) {
    .footer-logo {
        max-width: 100px;
    }
    
    .footer-text {
        font-size: 10px;
    }
    
    footer .lead {
        font-size: 0.85rem;
    }
}

