/* Mobile-First Responsive Styles for WhispSocio */

/* Mobile Navigation - Hamburger Menu */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem !important;
    }
    
    /* Show hamburger menu button */
    .navbar-toggler {
        display: block !important;
        border: none !important;
        padding: 0.25rem 0.5rem !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 4px !important;
    }
    
    .navbar-toggler:focus {
        box-shadow: none !important;
    }
    
    /* Use Bootstrap's default hamburger icon but make it white */
    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
        width: 24px !important;
        height: 24px !important;
    }
    
    /* Mobile menu container - ONLY when shown */
    .navbar-collapse {
        background: transparent !important;
        padding: 0 !important;
    }
    
    .navbar-collapse.show {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: var(--brand-gradient) !important;
        z-index: 1000 !important;
        padding: 1rem !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
        border-radius: 0 0 8px 8px !important;
        display: block !important;
    }
    
    .navbar-collapse:not(.show) {
        display: none !important;
    }
    
    /* Mobile menu items */
    .navbar-collapse .navbar-nav {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .navbar-collapse .navbar-nav .nav-item {
        width: 100% !important;
        margin: 0.25rem 0 !important;
    }
    
    .navbar-collapse .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
        color: white !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 6px !important;
        margin: 0.1rem 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        transition: background 0.3s !important;
    }
    
    .navbar-collapse .navbar-nav .nav-link:hover {
        background: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
    }
    
    .navbar-collapse .navbar-nav .nav-link i {
        margin-right: 0.5rem !important;
    }
    
    /* User info in mobile menu */
    .navbar-collapse .navbar-text {
        font-size: 0.85rem !important;
        padding: 0.75rem 1rem !important;
        color: white !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 6px !important;
        margin: 0.5rem 0 !important;
        display: flex !important;
        align-items: center !important;
        flex-wrap: wrap !important;
    }
    
    .navbar-collapse .navbar-text a {
        color: white !important;
        font-weight: bold !important;
        margin-right: 0.5rem !important;
    }
    
    .navbar-collapse .badge {
        font-size: 0.7rem !important;
        padding: 0.3rem 0.5rem !important;
        margin-top: 0.25rem !important;
    }
    
    /* Theme toggle in mobile menu */
    .navbar-collapse .nav-item .theme-toggle {
        background: rgba(255, 255, 255, 0.1) !important;
        border: none !important;
        color: white !important;
        padding: 0.75rem 1rem !important;
        border-radius: 6px !important;
        width: 100% !important;
        text-align: left !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    .navbar-collapse .nav-item .theme-toggle:hover {
        background: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
    }
    
    .navbar-collapse .nav-item .theme-toggle i {
        margin-right: 0.5rem !important;
    }
    
    /* Hide default navbar items when collapsed */
    .navbar-collapse:not(.show) .navbar-nav {
        display: none !important;
    }
}

/* Mobile Main Content */
@media (max-width: 768px) {
    .main-content {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Stack feed and sidebar on mobile */
    .col-lg-8, .col-lg-4 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    /* Mobile cards */
    .card {
        margin-bottom: 15px !important;
    }
    
    .card-header {
        padding: 0.75rem !important;
    }
    
    .card-body {
        padding: 0.75rem !important;
    }
    
    /* Mobile post form */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    textarea.form-control {
        min-height: 80px;
    }
    
    /* Mobile buttons */
    .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .btn-sm {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.8rem !important;
    }
}

/* Mobile Profile Page */
@media (max-width: 768px) {
    /* Profile banner responsive */
    .profile-banner-container {
        height: 200px !important;
    }
    
    /* Profile picture responsive */
    .profile-picture {
        width: 80px !important;
        height: 80px !important;
    }
    
    .profile-pic-edit {
        width: 25px !important;
        height: 25px !important;
        bottom: 3px !important;
        right: 3px !important;
    }
    
    .profile-pic-edit i {
        font-size: 0.7rem !important;
    }
    
    /* Profile info responsive */
    .profile-info h2 {
        font-size: 1.5rem !important;
    }
    
    .profile-info h5 {
        font-size: 1rem !important;
    }
    
    /* Media gallery responsive */
    .col-md-3, .col-sm-4, .col-6 {
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 50% !important;
    }
    
    /* Media item buttons */
    .btn-group-sm .btn {
        padding: 0.25rem 0.4rem !important;
        font-size: 0.7rem !important;
    }
    
    /* Inline editing responsive */
    .media-title-edit, .media-description-edit {
        font-size: 0.9rem !important;
    }
}

/* Mobile Feed Page */
@media (max-width: 768px) {
    /* Post cards responsive */
    .post-card {
        margin-bottom: 15px !important;
    }
    
    .post-header img {
        width: 35px !important;
        height: 35px !important;
    }
    
    .post-header .post-user-info h6 {
        font-size: 0.9rem !important;
    }
    
    .post-header .post-user-info small {
        font-size: 0.75rem !important;
    }
    
    /* Post content responsive */
    .post-content {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }
    
    /* Post actions responsive */
    .post-actions .btn {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.8rem !important;
    }
    
    /* Suggestions responsive */
    .suggestion-item {
        padding: 0.5rem 0 !important;
    }
    
    .suggestion-item img {
        width: 35px !important;
        height: 35px !important;
    }
    
    .suggestion-item h6 {
        font-size: 0.85rem !important;
    }
    
    .suggestion-item small {
        font-size: 0.7rem !important;
    }
    
    .suggestion-item .btn {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    /* Footer responsive */
    .footer .card-body {
        padding: 0.5rem !important;
    }
    
    .footer small {
        font-size: 0.7rem !important;
    }
    
    .footer a {
        font-size: 0.7rem !important;
        margin: 0.1rem !important;
    }
}

/* Mobile Messages Page */
@media (max-width: 768px) {
    /* Message list responsive */
    .message-item {
        padding: 0.75rem !important;
    }
    
    .message-item img {
        width: 40px !important;
        height: 40px !important;
    }
    
    .message-preview h6 {
        font-size: 0.9rem !important;
    }
    
    .message-preview small {
        font-size: 0.75rem !important;
    }
    
    /* Message content responsive */
    .message-content {
        font-size: 0.9rem !important;
    }
    
    .message-time {
        font-size: 0.7rem !important;
    }
}

/* Mobile Dashboard Page */
@media (max-width: 768px) {
    .dashboard-stats .col-md-3 {
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 50% !important;
        margin-bottom: 1rem;
    }
    
    .dashboard-stats .card {
        text-align: center;
    }
    
    .dashboard-stats h3 {
        font-size: 1.5rem !important;
    }
    
    .dashboard-stats p {
        font-size: 0.8rem !important;
    }
    
    /* Recent activity responsive */
    .activity-item {
        padding: 0.5rem !important;
    }
    
    .activity-item img {
        width: 30px !important;
        height: 30px !important;
    }
    
    .activity-content h6 {
        font-size: 0.85rem !important;
    }
    
    .activity-content small {
        font-size: 0.7rem !important;
    }
}

/* Mobile Notifications Page */
@media (max-width: 768px) {
    .notification-item {
        padding: 0.75rem !important;
    }
    
    .notification-item img {
        width: 35px !important;
        height: 35px !important;
    }
    
    .notification-content h6 {
        font-size: 0.85rem !important;
    }
    
    .notification-content small {
        font-size: 0.7rem !important;
    }
    
    .notification-actions .btn {
        padding: 0.25rem 0.4rem !important;
        font-size: 0.7rem !important;
    }
}

/* Mobile Auth Pages - Override auth.css for mobile */
@media (max-width: 768px) {
    .auth-container,
    .auth-container-improved {
        margin: 20px auto !important;
        padding: 30px 20px !important;
        max-width: 95% !important;
        border-radius: 15px !important;
    }
    
    .auth-header h2 {
        font-size: 1.5rem !important;
    }
    
    .auth-header {
        margin-bottom: 20px !important;
    }
    
    .form-control {
        padding: 10px 12px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    .btn-primary {
        padding: 10px 25px !important;
    }
}
    
    .btn {
        padding: 0.75rem 1.5rem !important;
    }
}

/* Mobile Modals */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
    
    .modal-header {
        padding: 0.75rem !important;
    }
    
    .modal-body {
        padding: 0.75rem !important;
    }
    
    .modal-footer {
        padding: 0.75rem !important;
    }
    
    .modal-title {
        font-size: 1rem !important;
    }
}

/* Mobile Alerts and Flash Messages */
@media (max-width: 768px) {
    .alert {
        padding: 0.75rem !important;
        margin-bottom: 10px !important;
    }
    
    .alert h6 {
        font-size: 0.9rem !important;
    }
    
    .alert p {
        font-size: 0.8rem !important;
    }
    
    .alert small {
        font-size: 0.75rem !important;
    }
}

/* Mobile Utility Classes */
@media (max-width: 768px) {
    .d-md-none {
        display: none !important;
    }
    
    .d-mobile-block {
        display: block !important;
    }
    
    .d-mobile-inline {
        display: inline !important;
    }
    
    .d-mobile-inline-block {
        display: inline-block !important;
    }
    
    .text-mobile-center {
        text-align: center !important;
    }
    
    .text-mobile-left {
        text-align: left !important;
    }
    
    .text-mobile-right {
        text-align: right !important;
    }
    
    .mb-mobile-2 {
        margin-bottom: 0.5rem !important;
    }
    
    .mb-mobile-3 {
        margin-bottom: 1rem !important;
    }
    
    .p-mobile-2 {
        padding: 0.5rem !important;
    }
    
    .p-mobile-3 {
        padding: 1rem !important;
    }
}

/* Mobile Touch Targets */
@media (max-width: 768px) {
    /* Ensure buttons are at least 44px for touch */
    .btn, .nav-link, .form-control {
        min-height: 44px;
    }
    
    .btn-sm {
        min-height: 36px;
    }
    
    /* Increase spacing for touch */
    .btn + .btn {
        margin-left: 0.5rem;
    }
    
    /* Better touch targets for links */
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Mobile Landscape Orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .auth-container,
    .auth-container-improved {
        margin: 10px auto !important;
        padding: 20px 15px !important;
    }
    
    .navbar {
        padding: 0.25rem 0 !important;
    }
    
    .main-content {
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }
}
