/* CSS para Páginas de Leilão */

/* Layout Principal */
.leilao-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    min-height: calc(100vh - 200px);
}

/* Seção Principal do Leilão */
.leilao-main {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Galeria de Imagens */
.leilao-gallery {
    position: relative;
    height: 400px;
    background: #f8f9fa;
}

.gallery-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.gallery-main:hover {
    transform: scale(1.05);
}

.gallery-thumbs {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.thumb-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.thumb-img:hover,
.thumb-img.active {
    opacity: 1;
    border-color: #3b82f6;
    transform: scale(1.1);
}

/* Informações do Veículo */
.leilao-info {
    padding: 30px;
}

.leilao-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
    line-height: 1.3;
}

.leilao-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.leilao-subtitle span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Status do Leilão */
.leilao-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.status-ativo {
    background: #dcfce7;
    color: #166534;
}

.status-finalizado {
    background: #fee2e2;
    color: #991b1b;
}

.status-agendado {
    background: #fef3c7;
    color: #92400e;
}

/* Especificações do Veículo */
.veiculo-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 25px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
}

.spec-item {
    text-align: center;
}

.spec-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.spec-value {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Descrição */
.leilao-description {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e5e7eb;
}

.leilao-description h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.leilao-description p {
    line-height: 1.7;
    color: #4b5563;
}

/* Sidebar de Lances */
.leilao-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Card de Lance Atual */
.lance-atual-card {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.lance-atual-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lance-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.lance-valor {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.lance-incremento {
    font-size: 12px;
    opacity: 0.8;
}

/* Countdown Timer */
.countdown-card {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border: 3px solid #ff4757;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
    position: relative;
    overflow: hidden;
}

.countdown-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.countdown-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 28px;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.countdown-time {
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 16px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.countdown-time.urgent {
    animation: urgentBlink 1s infinite;
    background: rgba(255, 255, 255, 0.9);
    color: #ff4757;
}

@keyframes urgentBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

.countdown-finished {
    color: #ffffff;
    font-weight: 800;
    font-size: 32px;
    text-shadow: 0 3px 6px rgba(0,0,0,0.4);
}

/* Timer de 3 minutos para finalização */
.final-countdown {
    background: linear-gradient(135deg, #ff4757, #c44569);
    border: 3px solid #ff3742;
    animation: finalCountdownPulse 1s infinite;
}

@keyframes finalCountdownPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Formulário de Lance */
.lance-form-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.lance-form-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lance-input-group {
    margin-bottom: 20px;
}

.lance-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.lance-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Botões de Lance Rápido */
.quick-bids {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.quick-bid-btn {
    padding: 10px;
    border: 2px solid #e5e7eb;
    background: #ffffff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-bid-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

/* Botão Principal de Lance */
.btn-bid-main {
    width: 100%;
    padding: 18px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-bid-main:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #667eea 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.6);
}

.btn-bid-main:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-bid-main .btn-shine {
    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.6s;
}

.btn-bid-main:hover .btn-shine {
    left: 100%;
}

.btn-bid-main:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-bid-main i {
    font-size: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* Histórico de Lances */
.lances-history-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-height: 500px;
    overflow: hidden;
}

.lances-history-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lances-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.lances-list::-webkit-scrollbar {
    width: 6px;
}

.lances-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.lances-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.lances-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Item de Lance */
.lance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 5px;
}

.lance-item:hover {
    background: #f8fafc;
}

.lance-item.slide-in {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.lance-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lance-usuario {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

.lance-user {
    color: #3b82f6;
}

.lance-bot {
    color: #6b7280;
    font-style: italic;
}

.lance-valor {
    font-weight: 700;
    color: #10b981;
    font-size: 16px;
}

.lance-time {
    font-size: 12px;
    color: #9ca3af;
    text-align: right;
}

/* Controles de Áudio e Auto-refresh */
.leilao-controls {
    background: #ffffff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.control-label {
    font-size: 14px;
    color: #4b5563;
    font-weight: 500;
}

.control-toggle {
    background: #e5e7eb;
    border: none;
    border-radius: 20px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.control-toggle.active {
    background: #3b82f6;
    color: white;
}

/* Modal de Vitória */
.vitoria-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.5s ease;
}

.vitoria-content {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: scaleIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.vitoria-header h2 {
    font-size: 28px;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.vitoria-header p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 30px;
}

.vitoria-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-2px);
}

.btn-close {
    background: #6b7280;
    color: white;
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: #4b5563;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ffffff;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transform: translateX(400px);
    transition: all 0.3s ease;
    border-left: 4px solid #3b82f6;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left-color: #10b981;
}

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

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    animation: confetti-fall 3s linear forwards;
    z-index: 9999;
}

@keyframes confetti-fall {
    0% {
        top: -10px;
        transform: rotateZ(0deg);
    }
    100% {
        top: 100vh;
        transform: rotateZ(720deg);
    }
}

/* Animação de Valor Atualizado */
.value-updated {
    animation: valueUpdate 1s ease;
}

@keyframes valueUpdate {
    0% {
        background: #fef3c7;
        transform: scale(1);
    }
    50% {
        background: #fbbf24;
        transform: scale(1.05);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

/* Responsividade */
@media (max-width: 1024px) {
    .leilao-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .leilao-sidebar {
        order: -1;
    }
    
    .lance-atual-card {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        text-align: left;
    }
}

@media (max-width: 768px) {
    .leilao-container {
        padding: 15px;
    }
    
    .leilao-gallery {
        height: 300px;
    }
    
    .leilao-info {
        padding: 20px;
    }
    
    .leilao-title {
        font-size: 24px;
    }
    
    .lance-valor {
        font-size: 28px;
    }
    
    .veiculo-specs {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-bids {
        grid-template-columns: 1fr;
    }
    
    .vitoria-content {
        padding: 30px 20px;
    }
    
    .vitoria-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .leilao-container {
        padding: 10px;
    }
    
    .leilao-title {
        font-size: 20px;
    }
    
    .lance-valor {
        font-size: 24px;
    }
    
    .veiculo-specs {
        grid-template-columns: 1fr;
    }
    
    .countdown-display {
        font-size: 18px;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}