/**
 * Estilos para el Panel de Bares de Wingman
 * Incluye autenticación, dashboard y componentes específicos
 */

/* Panel principal */
.bar-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    background: linear-gradient(135deg, rgba(32, 32, 32, 0.98) 0%, rgba(42, 42, 42, 0.95) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 2px solid rgba(255, 95, 69, 0.3);
    box-shadow: -15px 0 40px rgba(0, 0, 0, 0.6);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    overflow-y: auto;
}

.bar-panel.active {
    right: 0;
}

.bar-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid rgba(255, 95, 69, 0.2);
    background: rgba(32, 32, 32, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.bar-panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    background: linear-gradient(135deg, #FF5F45 0%, #FF7A63 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-panel {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 1.5rem;
    color: #e0e0e0;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.close-panel:hover {
    background: rgba(255, 95, 69, 0.2);
    color: #FF5F45;
    transform: rotate(90deg);
    box-shadow: 0 0 20px rgba(255, 95, 69, 0.3);
}

.bar-panel-content {
    padding: 2rem;
}

/* Sección de autenticación */
.bar-auth-section {
    max-width: 400px;
    margin: 0 auto;
}

.auth-welcome {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-welcome h2 {
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #FF5F45 0%, #FF7A63 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-welcome p {
    color: #b0b0b0;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.contact-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 95, 69, 0.1) 0%, rgba(255, 122, 99, 0.1) 100%);
    border: 1px solid rgba(255, 95, 69, 0.3);
    border-radius: 12px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-align: center;
}

.contact-btn:hover {
    background: linear-gradient(135deg, rgba(255, 95, 69, 0.2) 0%, rgba(255, 122, 99, 0.2) 100%);
    border-color: rgba(255, 95, 69, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 95, 69, 0.3);
}

.contact-btn i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #FF5F45;
}

.contact-btn:first-child i {
    color: #e74c3c;
}

.contact-btn:last-child i {
    color: #25d366;
}

.divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    color: #666;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 95, 69, 0.2);
}

.divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
    color: #b0b0b0;
}

.auth-form {
    background: rgba(42, 42, 42, 0.8);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 95, 69, 0.2);
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255, 95, 69, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(53, 53, 53, 0.8);
    color: #ffffff;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-group input::placeholder {
    color: #b0b0b0;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #FF5F45;
    box-shadow: 0 0 0 3px rgba(255, 95, 69, 0.2);
    background: rgba(53, 53, 53, 0.9);
}

.form-group.focused label {
    color: #FF5F45;
    transform: translateY(-2px);
}

/* Sección del dashboard */
.bar-dashboard-section {
    display: none;
}

.dashboard-header {
    background: linear-gradient(135deg, #FF5F45 0%, #FF7A5C 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.bar-info {
    background: rgba(42, 42, 42, 0.8);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 95, 69, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.bar-info h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: #ffffff;
    background: linear-gradient(135deg, #FF5F45 0%, #FF7A63 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bar-info h3 {
    margin: 0 0 0.5rem 0;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(135deg, #FF5F45 0%, #FF7A63 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bar-info p {
    margin: 0;
    opacity: 0.9;
    color: #b0b0b0;
}

.status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
    backdrop-filter: blur(10px);
}

.status.active {
    background: rgba(34, 197, 94, 0.2);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status.pending {
    background: rgba(251, 191, 36, 0.2);
    color: #d97706;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Tabs del dashboard */
.dashboard-tabs {
    display: flex;
    margin-bottom: 2rem;
    background: rgba(42, 42, 42, 0.6);
    border-radius: 12px;
    padding: 4px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 95, 69, 0.2);
}

.bar-tab-btn {
    flex: 1;
    padding: 0.875rem 1rem;
    background: none;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    color: #b0b0b0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.bar-tab-btn.active {
    background: linear-gradient(135deg, #FF5F45 0%, #FF7A63 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 95, 69, 0.4);
}

.bar-tab-btn:hover:not(.active) {
    background: rgba(255, 95, 69, 0.1);
    color: #FF5F45;
}

.bar-tab-content {
    display: none;
}

.bar-tab-content.active {
    display: block;
}

/* Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.8);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #FF5F45;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-weight: 500;
}

/* Lista de visitas */
.visits-list {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.visit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease;
}

.visit-item:hover {
    background: rgba(255, 95, 69, 0.05);
}

.visit-item:last-child {
    border-bottom: none;
}

.visit-info h4 {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    color: #333;
}

.visit-info p {
    margin: 0;
    color: #666;
    font-size: 0.875rem;
}

/* Códigos QR */
.qr-section {
    background: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.qr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.qr-header h3 {
    margin: 0;
    color: #333;
}

.qr-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.qr-item:last-child {
    margin-bottom: 0;
}

.qr-info h4 {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    color: #333;
    font-family: 'Courier New', monospace;
}

.qr-info p {
    margin: 0;
    color: #666;
    font-size: 0.875rem;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    backdrop-filter: blur(10px);
}

.btn-primary {
    background: linear-gradient(135deg, #FF5F45 0%, #FF7A5C 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 95, 69, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 95, 69, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 95, 69, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 95, 69, 0.1);
    color: #ffffff;
    border-color: rgba(255, 95, 69, 0.3);
    transform: translateY(-2px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

/* Loader */
.bar-panel-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 95, 69, 0.2);
    border-top: 4px solid #FF5F45;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loader-text {
    color: #666;
    font-weight: 500;
}

/* Notificaciones */
.bar-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #FF5F45;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10002;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

.bar-notification.success {
    border-left-color: #22c55e;
}

.bar-notification.error {
    border-left-color: #ef4444;
}

.bar-notification i {
    font-size: 1.25rem;
}

.bar-notification.success i {
    color: #22c55e;
}

.bar-notification.error i {
    color: #ef4444;
}

.close-notification {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
}

/* Overlay cuando el panel está abierto */
body.panel-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    backdrop-filter: blur(2px);
}

/* Estados vacíos */
.no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* Animaciones */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .bar-panel {
        width: 100%;
        max-width: none;
    }
    
    .bar-panel-header {
        padding: 1rem;
    }
    
    .bar-panel-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-tabs {
        flex-direction: column;
    }
    
    .bar-tab-btn {
        text-align: left;
    }
    
    .visit-item,
    .qr-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .bar-notification {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-tabs {
        flex-direction: column;
    }
}