/* Estilos personalizados para Pildora Roja */

:root {
    --primary-color: #E63946;
    --primary-dark: #C92A35;
    --secondary-color: #2D3436;
    --accent-color: #FFD60A;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --success-color: #28a745;
    --error-color: #dc3545;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 5px 15px rgba(0,0,0,0.15);
    --shadow-xl: 0 10px 25px rgba(0,0,0,0.18);
    --transition-fast: 150ms;
    --transition-normal: 300ms;
    --transition-slow: 500ms;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #E63946 0%, #C92A35 100%);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-animation {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-animation i {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

/* Navegación */
.navbar {
    backdrop-filter: blur(10px);
    background-color: #121212 !important;
    background: #121212 !important;
    transition: all var(--transition-normal) ease;
    box-shadow: var(--shadow-md);
    padding: 12px 0 !important;
}

.navbar.navbar-dark {
    background-color: #121212 !important;
    background: #121212 !important;
}

.navbar.navbar-expand-lg {
    background-color: #121212 !important;
    background: #121212 !important;
}

nav.navbar {
    background-color: #121212 !important;
    background: #121212 !important;
}

.navbar-dark {
    background-color: #121212 !important;
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
    transition: all var(--transition-normal) ease;
    display: flex;
    align-items: center;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.logo-navbar {
    height: 50px;
    width: auto;
    transition: all var(--transition-normal) ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.navbar-brand:hover .logo-navbar {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all var(--transition-normal) ease;
    color: rgba(255,255,255,0.9) !important;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--accent-color) !important;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width var(--transition-normal) ease;
}

.navbar-nav .nav-link:hover::after {
    width: 100%;
}

/* Cards */
.card {
    transition: all var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.card-body {
    padding: 30px;
}

.card i {
    transition: all var(--transition-normal) ease;
    color: var(--primary-color);
}

.card:hover i {
    transform: scale(1.15) rotate(5deg);
    color: var(--primary-dark);
}

.card-title {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 15px;
}

.card-text {
    color: #666;
    line-height: 1.6;
}

/* Botones */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 12px 30px;
    transition: all var(--transition-normal) ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-warning {
    background: var(--accent-color);
    color: var(--dark-color);
    border-color: var(--accent-color);
    font-weight: 600;
}

.btn-warning:hover {
    background: #f0c800;
    border-color: #e0b800;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-light {
    border: 2px solid white;
    color: white;
    background: transparent;
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Formularios */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    transition: all var(--transition-normal) ease;
    font-size: 1rem;
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
    background-color: white;
}

.form-control::placeholder {
    color: #999;
    opacity: 0.7;
}

.form-control.is-valid {
    border-color: var(--success-color);
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.form-control.is-invalid {
    border-color: var(--error-color);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-text {
    font-size: 0.875rem;
    color: #666;
    margin-top: 4px;
}

.invalid-feedback {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 4px;
    display: block;
}

/* Chat Widget */
.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.chat-button:hover {
    box-shadow: var(--shadow-xl);
    transform: scale(1.1);
}

.chat-container {
    border-radius: 12px;
    box-shadow: var(--shadow-xxl);
    background: white;
    animation: slideUp var(--transition-normal) ease;
}

.chat-message {
    margin-bottom: 16px;
    animation: fadeIn var(--transition-normal) ease;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
    padding: 12px 16px;
    display: inline-block;
    max-width: 80%;
    word-wrap: break-word;
}

.chat-message.agent .message-bubble {
    background: #f0f0f0;
    color: var(--dark-color);
    border-radius: 18px 18px 18px 4px;
    padding: 12px 16px;
    display: inline-block;
    max-width: 80%;
    word-wrap: break-word;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-warning {
    background: var(--accent-color);
    color: var(--dark-color);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #1a1a1f 100%);
    color: white;
}

footer p {
    color: rgba(255,255,255,0.85) !important;
    font-size: 0.95rem;
}

footer .text-muted {
    color: rgba(255,255,255,0.85) !important;
}

footer a {
    transition: all var(--transition-normal) ease;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}

footer a:hover {
    color: var(--accent-color) !important;
    transform: translateX(2px);
}

footer h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.25rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all var(--transition-normal) ease;
    margin-right: 10px;
}

.social-icon:hover {
    background: var(--primary-color);
    transform: scale(1.1) translateY(-3px);
}

/* Animaciones */
.fade-in {
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1024px) {
    :root {
        --font-size-h1: 2.5rem;
        --font-size-h2: 2rem;
    }
    
    .card {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    :root {
        --font-size-h1: 2rem;
        --font-size-h2: 1.5rem;
    }
    
    .hero-section .display-3 {
        font-size: 2rem;
    }
    
    .hero-section .display-4 {
        font-size: 1.75rem;
    }
    
    .card {
        margin-bottom: 20px;
        padding: 20px;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .navbar-nav .nav-link {
        padding: 10px 0;
    }
    
    .chat-message.user .message-bubble,
    .chat-message.agent .message-bubble {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .hero-section {
        min-height: 100vh;
        padding: 100px 20px 40px 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .hero-content {
        text-align: center;
        width: 100%;
    }
    
    .display-3 {
        font-size: 1.75rem !important;
        line-height: 1.2;
        margin-bottom: 15px;
    }
    
    .lead {
        font-size: 0.95rem !important;
        line-height: 1.5;
    }
    
    /* Market Stats Mobile */
    .market-stats {
        margin: 20px 0;
        padding: 15px 0;
    }
    
    .market-stats .row {
        gap: 15px;
    }
    
    .stat-item {
        padding: 15px 12px;
        margin-bottom: 0;
        background: rgba(255,255,255,0.05);
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,0.1);
    }
    
    .stat-number {
        font-size: 1.8rem;
        margin-bottom: 8px;
        word-break: break-word;
    }
    
    .stat-label {
        font-size: 0.8rem;
        margin-bottom: 4px;
        line-height: 1.3;
        font-weight: 500;
    }
    
    .stat-desc {
        font-size: 0.7rem;
        opacity: 0.8;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .form-control {
        font-size: 16px;
        padding: 12px 14px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 10px !important;
    }
    
    .navbar-brand img {
        height: 40px !important;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
    }
    
    h1, h2, h3, h4, h5, h6 {
        margin-bottom: 15px;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .col-md-4, .col-md-6 {
        padding-left: 10px;
        padding-right: 10px;
        margin-bottom: 15px;
    }
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Loading animation */
.loading {
    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); }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible para navegación por teclado */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Market Stats */
.market-stats {
    margin: 30px 0;
    padding: 20px 0;
}

.stat-item {
    text-align: center;
    padding: 15px 10px;
    transition: all var(--transition-normal) ease;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.95rem;
    color: white;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.3;
}

.stat-desc {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
}

/* Utilidades */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.rounded-lg {
    border-radius: 12px;
}
