/* TECH TIPS Mobile Optimization Styles */
/* PWA and Mobile-Specific Enhancements */

/* === PWA Status Indicators === */
.offline-status-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1050;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.offline-status-indicator.online {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
}

.offline-status-indicator.offline {
    background: linear-gradient(135deg, #f44336, #c62828);
    color: white;
    animation: pulse 2s infinite;
}

.offline-status-indicator .status-icon {
    margin-right: 5px;
}

/* === PWA Install Button === */
.install-app-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1040;
    background: linear-gradient(135deg, #6c5ce7, #5a4dd4);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
    transition: all 0.3s ease;
    display: none;
}

.install-app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
    color: white;
}

.install-app-btn i {
    margin-right: 8px;
}

/* === Update Banner === */
.update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1060;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease;
}

.update-banner .update-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.update-banner .update-content i {
    font-size: 1.2rem;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* === Offline Notifications === */
.offline-notification-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1055;
    background: linear-gradient(135deg, #607d8b, #455a64);
    color: white;
    padding: 12px;
    text-align: center;
    animation: slideDown 0.3s ease;
}

.offline-notification-bar .offline-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.offline-notification-bar .dismiss-offline-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 15px;
    padding: 2px 8px;
    font-size: 0.875rem;
}

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 1050;
    max-width: 350px;
}

.toast-notification {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    overflow: hidden;
    animation: slideInRight 0.3s ease;
}

.toast-notification.toast-success {
    border-left: 4px solid #4caf50;
}

.toast-notification.toast-error {
    border-left: 4px solid #f44336;
}

.toast-notification.toast-warning {
    border-left: 4px solid #ff9800;
}

.toast-notification.toast-info {
    border-left: 4px solid #2196f3;
}

.toast-notification .toast-header {
    background: #f8f9fa;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}

.toast-notification .toast-body {
    padding: 12px 15px;
    color: #666;
}

.toast-notification .btn-close-toast {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* === Offline Data Manager === */
.offline-data-manager {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1040;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 15px;
    min-width: 250px;
    border: 1px solid #eee;
}

.offline-data-manager .manager-content h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1rem;
}

.offline-data-manager .queue-status {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.875rem;
}

.offline-data-manager .queue-count {
    font-weight: 600;
    color: #2e7d32;
}

.offline-data-manager .manager-actions {
    display: flex;
    gap: 8px;
}

.offline-data-manager .manager-actions .btn {
    flex: 1;
    font-size: 0.875rem;
}

/* === Offline Form Indicators === */
.offline-indicator {
    background: linear-gradient(135deg, #673ab7, #5e35b1);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.offline-indicator i {
    font-size: 1rem;
}

.offline-feedback {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === Cached Content Notices === */
.cached-content-notice {
    border: none;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border-left: 4px solid #2196f3;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.stale-content-warning {
    border: none;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    color: #e65100;
    border-left: 4px solid #ff9800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* === Mobile-Specific Optimizations === */

/* Touch-friendly buttons */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 8px 15px;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        min-height: 54px;
        padding: 16px 25px;
        font-size: 1.125rem;
    }
}

/* Mobile navigation enhancements */
@media (max-width: 768px) {
    .navbar-nav .nav-link {
        padding: 15px 20px;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-toggler {
        border: none;
        padding: 8px;
        font-size: 1.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
}

/* Mobile form optimizations */
@media (max-width: 768px) {
    .form-control, 
    .form-select {
        min-height: 44px;
        font-size: 1rem;
        padding: 12px 15px;
    }
    
    .form-check-input {
        width: 1.5rem;
        height: 1.5rem;
        margin-top: 0.125em;
    }
    
    .form-check-label {
        padding-left: 0.5rem;
        font-size: 1rem;
    }
}

/* Mobile card optimizations */
@media (max-width: 768px) {
    .card {
        margin-bottom: 20px;
        border-radius: 15px;
        overflow: hidden;
    }
    
    .card-body {
        padding: 20px 15px;
    }
    
    .card-title {
        font-size: 1.25rem;
        margin-bottom: 15px;
    }
    
    .card-text {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* Mobile table responsiveness */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
    }
    
    .table-mobile-stack {
        display: block;
    }
    
    .table-mobile-stack thead {
        display: none;
    }
    
    .table-mobile-stack tbody,
    .table-mobile-stack tr,
    .table-mobile-stack td {
        display: block;
        width: 100%;
    }
    
    .table-mobile-stack tr {
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 10px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    
    .table-mobile-stack td {
        border: none;
        padding: 8px 0;
        text-align: left !important;
        position: relative;
        padding-left: 35%;
    }
    
    .table-mobile-stack td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 30%;
        font-weight: 600;
        color: #666;
        white-space: nowrap;
    }
}

/* Mobile modal optimizations */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-content {
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 20px;
        border-bottom: 1px solid #eee;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 15px 20px;
        border-top: 1px solid #eee;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
}

/* Mobile search optimizations */
@media (max-width: 768px) {
    .search-container {
        position: relative;
        margin-bottom: 20px;
    }
    
    .search-input {
        width: 100%;
        height: 50px;
        padding: 15px 50px 15px 20px;
        border: 2px solid #e0e0e0;
        border-radius: 25px;
        font-size: 1rem;
        background: #f8f9fa;
    }
    
    .search-input:focus {
        outline: none;
        border-color: #2e7d32;
        background: white;
        box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
    }
    
    .search-btn {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: #666;
        font-size: 1.2rem;
        padding: 8px;
    }
}

/* Mobile filter optimizations */
@media (max-width: 768px) {
    .filter-container {
        background: white;
        border-radius: 15px;
        padding: 20px;
        margin-bottom: 20px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    
    .filter-title {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 15px;
        color: #333;
    }
    
    .filter-group {
        margin-bottom: 20px;
    }
    
    .filter-label {
        font-weight: 500;
        color: #666;
        margin-bottom: 8px;
        display: block;
    }
}

/* Mobile rating system */
@media (max-width: 768px) {
    .rating-stars {
        display: flex;
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .rating-star {
        font-size: 1.5rem;
        color: #ddd;
        cursor: pointer;
        transition: color 0.2s ease;
        padding: 5px;
    }
    
    .rating-star.active,
    .rating-star:hover {
        color: #ffc107;
    }
    
    .rating-feedback {
        margin-top: 15px;
    }
    
    .rating-feedback textarea {
        min-height: 100px;
        resize: vertical;
    }
}

/* Mobile payment optimizations */
@media (max-width: 768px) {
    .payment-method {
        border: 2px solid #e0e0e0;
        border-radius: 15px;
        padding: 20px;
        margin-bottom: 15px;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .payment-method.active {
        border-color: #2e7d32;
        background: #f1f8e9;
    }
    
    .payment-method-icon {
        font-size: 1.5rem;
        margin-bottom: 10px;
        color: #666;
    }
    
    .payment-method.active .payment-method-icon {
        color: #2e7d32;
    }
    
    .payment-method-title {
        font-weight: 600;
        margin-bottom: 5px;
    }
    
    .payment-method-desc {
        font-size: 0.875rem;
        color: #666;
    }
}

/* PWA-specific styles */
@media all and (display-mode: standalone) {
    body {
        /* Add PWA-specific styles when app is installed */
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .navbar {
        padding-top: calc(10px + env(safe-area-inset-top));
    }
    
    .install-app-btn {
        display: none !important;
    }
}

/* Dark mode support for PWA */
@media (prefers-color-scheme: dark) {
    .offline-status-indicator.online {
        background: linear-gradient(135deg, #388e3c, #2e7d32);
    }
    
    .offline-status-indicator.offline {
        background: linear-gradient(135deg, #d32f2f, #c62828);
    }
    
    .toast-notification {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .toast-notification .toast-header {
        background: #3d3d3d;
        color: #e0e0e0;
        border-bottom-color: #555;
    }
    
    .offline-data-manager {
        background: #2d2d2d;
        color: #e0e0e0;
        border-color: #555;
    }
    
    .cached-content-notice {
        background: linear-gradient(135deg, #1a237e, #3949ab);
        color: #e3f2fd;
    }
    
    .stale-content-warning {
        background: linear-gradient(135deg, #e65100, #ff9800);
        color: #fff8e1;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .offline-status-indicator,
    .update-banner,
    .toast-notification,
    .install-app-btn {
        animation: none;
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }
    
    .form-control,
    .form-select {
        border-width: 2px;
    }
    
    .card {
        border-width: 2px;
    }
}

/* Large text support */
@media (prefers-reduced-motion: no-preference) {
    .pulse {
        animation: pulse 2s infinite;
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* Custom scrollbar for mobile */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 2px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #999;
    }
}

/* Mobile landscape optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar {
        padding: 8px 15px;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
    }
    
    .offline-status-indicator {
        top: 5px;
        right: 5px;
        padding: 5px 8px;
        font-size: 0.8rem;
    }
    
    .install-app-btn {
        bottom: 10px;
        left: 10px;
        padding: 8px 15px;
        font-size: 0.875rem;
    }
}
