:root {
    --primary-color: #6cd9fd;
    --secondary-color: #45c5eb;
    --accent-color: #2c3e50;
    --light-blue: rgba(108, 217, 253, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-white: #ffffff;
    --text-dark: #2c3e50;
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-white);
    overflow-x: hidden;
}

/* Fondo animado */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(108, 217, 253, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(108, 217, 253, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
    z-index: -1;
}

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

/* Header principal */
.main-header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.header-logo {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-dark);
    box-shadow: 0 8px 25px rgba(108, 217, 253, 0.4);
}

.header-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    color: var(--primary-color);
}

/* Contenedor principal */
.main-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Formulario de consulta */
.consult-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 2.5rem;
    border: 2px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.consult-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
}

.section-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-size: 1.1rem;
}

/* Campos de formulario mejorados */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    color: var(--text-white);
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-group {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(108, 217, 253, 0.5);
}

.input-group-text {
    background: var(--primary-color);
    color: var(--text-dark);
    border: none;
    font-weight: 600;
    padding: 1rem;
    border-radius: 15px 0 0 15px;
}

.form-control {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--text-dark);
    font-weight: 500;
    padding: 1rem;
    border-radius: 0 15px 15px 0;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: none;
    border: none;
}

/* Botones mejorados */
.btn-action {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-dark);
    font-weight: 700;
    border: none;
    padding: 1rem 2rem;
    border-radius: 15px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

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

.btn-action:hover::before {
    left: 100%;
}

.btn-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(108, 217, 253, 0.5);
    color: var(--text-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--text-white);
    border: 2px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--glass-border);
    color: var(--text-white);
}

/* Sección de resultados */
.results-section {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    margin-top: 2rem;
}

.info-panel, .images-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 2rem;
    border: 2px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
}

.info-panel:hover, .images-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* Información del paciente */
.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 10px;
    margin: 0 -1rem;
}

.info-label {
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-value {
    font-weight: 600;
    color: var(--text-white);
}

.badge-status {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* Panel de imágenes mejorado */
.image-carousel-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-item {
    height: 500px !important;
    align-items: center !important;
    justify-content: center !important;
    /* background: rgba(0, 0, 0, 0.8); */
}

.carousel-item img {
    max-width: 100% !important;
    max-height: 480px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.carousel-item img:hover {
    transform: scale(1.05);
    cursor: pointer;
}

.carousel-control-prev, .carousel-control-next {
    background: rgba(108, 217, 253, 0.8);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.carousel-control-prev:hover, .carousel-control-next:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.carousel-control-prev {
    left: 15px;
}

.carousel-control-next {
    right: 15px;
}

.image-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.carousel-indicators {
    bottom: -50px;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    margin: 0 5px;
    transition: all 0.3s ease;
}

.carousel-indicators button.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* Estados de carga y sin imágenes */
.images-loading, .no-images-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 500px;
    text-align: center;
    color: var(--text-white);
}

.images-loading .spinner-border {
    color: var(--primary-color);
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

.no-images-message i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
    color: var(--primary-color);
}

/* Panel de acciones */
.actions-panel {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-sm {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: white;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: #161616;
}

.btn-outline-secondary {
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: var(--text-white);
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

/* Modal mejorado */
.image-modal .modal-dialog {
    max-width: 90vw;
    max-height: 90vh;
}

.image-modal .modal-content {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 20px;
    border: 2px solid var(--glass-border);
    backdrop-filter: blur(20px);
}

.image-modal .modal-body {
    padding: 2rem;
    text-align: center;
}

.image-modal img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }

    .consult-section {
        padding: 1.5rem;
    }

    .results-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-panel, .images-panel {
        padding: 1.5rem;
    }

    .carousel-item {
        height: 350px !important;
    }

    .carousel-item img {
        max-height: 330px !important;
    }

    .image-carousel-container {
        min-height: 350px;
    }

    .images-loading, .no-images-message {
        height: 350px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .header-title {
        font-size: 1.4rem;
    }

    .header-subtitle {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .section-title {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}