/**
 * SPA (Single Page Application) Styles
 * For Distribuidora Lion
 */

/* Page Transitions */
.page-loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background-color: #ff6600;
    z-index: 9999;
    width: 0%;
    transition: width 0.3s ease;
    opacity: 0.7;
}

.page-loading-indicator.loading {
    width: 90%;
    transition: width 2s ease;
}

.page-loading-indicator.complete {
    width: 100%;
    transition: width 0.2s ease;
}

/* Tab-like Navigation */
.nav-links {
    position: relative;
}

.nav-links a {
    position: relative;
    transition: color 0.3s;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 0;
    height: 3px;
    background-color: #ff6600;
    transition: width 0.3s ease;
}

.nav-links a.active::after {
    width: 100%;
}

.nav-links a.active {
    color: #ff6600;
    font-weight: 500;
}

/* Admin Navigation Tabs */
.admin-nav {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.admin-nav a {
    position: relative;
    padding: 1rem 1.5rem;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-nav a:hover {
    background-color: #f8f9fa;
    color: #ff6600;
}

.admin-nav a i {
    font-size: 1.1rem;
}

.admin-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: #ff6600;
    transition: width 0.3s ease;
}

.admin-nav a.active {
    color: #ff6600;
    background-color: #fff9f5;
}

.admin-nav a.active::after {
    width: 100%;
}

/* Main content transitions */
main {
    transition: opacity 0.3s ease;
}

main.fade {
    opacity: 0.5;
}

/* Content wrapper transitions */
.content-wrapper {
    opacity: 1;
    transition: opacity 0.15s linear;
}

.content-wrapper.active {
    position: relative;
    z-index: 2;
}

.content-wrapper.inactive {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
}

/* Form Message Styles */
.form-message {
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

.form-message.success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 4px solid #28a745;
    color: #155724;
}

.form-message.error {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.form-message.warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    color: #856404;
}

.form-message.info {
    background-color: rgba(23, 162, 184, 0.1);
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 90px; /* Position above the WhatsApp button */
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    min-width: 200px;
    max-width: 320px;
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
    transform: translateX(50px);
}

@keyframes slideIn {
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOut {
    to { opacity: 0; transform: translateX(50px); }
}

.toast.success { background-color: #4CAF50; }
.toast.error { background-color: #f44336; }
.toast.warning { background-color: #ff9800; }
.toast.info { background-color: #2196F3; }

.toast i {
    margin-right: 10px;
    font-size: 18px;
}

/* Button Animation Classes */
.btn-pulse {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-cart.added {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

/* Badge Animation */
.pulse {
    animation: badgePulse 0.5s ease;
}

@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* Loading Indicator */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal Animation Enhancements */
.modal {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-content.show {
    transform: translateY(0);
    opacity: 1;
}

/* Media Queries */
@media (max-width: 768px) {
    .admin-nav {
        flex-direction: column;
    }
    
    .admin-nav a {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .admin-nav a:last-child {
        border-bottom: none;
    }
}

/* Responsive adjustment for mobile devices */
@media (max-width: 576px) {
    .toast-container {
        bottom: 80px; /* Adjust for the smaller WhatsApp button on mobile */
    }
} 