/* Mobile-specific Components */

/* PWA Prompt */
.pwa-prompt {
    position: fixed;
    top: -100px;
    left: 0;
    right: 0;
    background: var(--gradient-gold);
    color: var(--silver-dark);
    padding: 1rem;
    transition: top 0.3s ease;
    z-index: 3000;
    font-weight: 600;
}

.pwa-prompt.show {
    top: 0;
}

.pwa-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 500px;
    margin: 0 auto;
    cursor: pointer;
}

.pwa-close {
    background: none;
    border: none;
    color: var(--silver-dark);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.pwa-close:hover {
    transform: scale(1.2);
}

/* Pull to Refresh */
.pull-refresh {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-gold);
    color: var(--silver-dark);
    padding: 1rem;
    border-radius: 50px;
    transition: top 0.3s ease;
    z-index: 1001;
    font-weight: 600;
}

.pull-refresh.active {
    top: 10px;
}

.refresh-spinner {
    animation: spin 1s linear infinite;
}

/* Scanner Modal */
.scanner-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 44, 44, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 3000;
    backdrop-filter: blur(10px);
}

.scanner-modal.active {
    opacity: 1;
    visibility: visible;
}

.scanner-container {
    width: 90%;
    max-width: 400px;
}

.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--gold-light);
}

.scanner-header h3 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.scanner-close {
    background: none;
    border: none;
    color: var(--gold-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scanner-close:hover {
    transform: scale(1.2);
    color: var(--gold-primary);
}

.scanner-preview {
    position: relative;
    width: 100%;
    height: 300px;
    background: var(--silver-dark);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--gold-primary);
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-frame {
    width: 250px;
    height: 150px;
    border: 2px solid var(--gold-primary);
    border-radius: 10px;
    position: relative;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.scanner-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold-light);
    animation: scan 2s linear infinite;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.scanner-toggle {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--gradient-gold);
    color: var(--silver-dark);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.scanner-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.scanner-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.scanner-toggle:hover::before {
    left: 100%;
}

/* Voice Modal */
.voice-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 44, 44, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 3000;
    backdrop-filter: blur(10px);
}

.voice-modal.active {
    opacity: 1;
    visibility: visible;
}

.voice-container {
    text-align: center;
    color: var(--gold-light);
}

.voice-wave {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: 2rem;
    height: 40px; 
    align-items: flex-end;
}

.wave-bar {
    width: 4px;
    height: 40px;
    background: var(--gradient-gold);
    border-radius: 2px;
    animation: wave 0.8s ease-in-out infinite alternate;
    transform-origin: bottom;
}

.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }

.voice-text {
    color: var(--gold-light);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.voice-close {
    width: 60px;
    height: 60px;
    background: var(--gradient-gold);
    color: var(--silver-dark);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

.voice-close:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

/* Invalid Tracking Modal */
.tracking-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 44, 44, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 3500; /* Higher than other modals */
    backdrop-filter: blur(10px);
}

.tracking-error-modal.active {
    opacity: 1;
    visibility: visible;
}

.error-container {
    width: 90%;
    max-width: 450px;
    background: var(--silver-medium);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-gold);
    border: 2px solid var(--gold-primary);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.tracking-error-modal.active .error-container {
    transform: scale(1);
}

.error-icon {
    font-size: 3rem;
    color: var(--gold-primary);
    margin-bottom: 1rem;
}

.error-title {
    color: var(--gold-light);
    margin-bottom: 0.5rem;
}

.error-message {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.error-suggestion {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding: 10px;
    background: var(--silver-dark);
    border-radius: 8px;
}

.error-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.error-action-btn {
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.error-action-btn.primary {
    background: var(--gradient-gold);
    color: var(--silver-dark);
}

.error-action-btn.secondary {
    background: var(--silver-dark);
    color: var(--gold-light);
    border: 1px solid var(--gold-primary);
}

.error-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

/* Notification Permission */
.notification-permission {
    position: fixed;
    bottom: -200px;
    left: 0;
    right: 0;
    background: var(--silver-medium);
    padding: 1.5rem;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    transition: bottom 0.3s ease;
    z-index: 2500;
    border-top: 2px solid var(--gold-primary);
}

.notification-permission.show {
    bottom: 80px;
}

.permission-content {
    text-align: center;
}

.permission-content i {
    font-size: 3rem;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.permission-content h4 {
    color: var(--gold-light);
    margin-bottom: 0.5rem;
}

.permission-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.permission-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.permission-btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.permission-btn.allow {
    background: var(--gradient-gold);
    color: var(--silver-dark);
}

.permission-btn.deny {
    background: var(--silver-light);
    color: var(--text-muted);
}

.permission-btn:hover {
    transform: translateY(-2px);
}

.permission-btn.allow:hover {
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pwa-prompt {
        display: block;
    }
}