/*
 * MedoraX - Estilos futuristas e tecnológicos
 * Autor: Manus AI (Revisão para Vinicius de Souza Santos)
 */

/* Variáveis CSS para o tema Cyber-Médico */
:root {
    --color-primary: #00eaff; /* Ciano Neon - Cor principal */
    --color-secondary: #ff0077; /* Magenta Neon - Cor de destaque */
    --color-background: #0a0a0a; /* Fundo Ultra Escuro */
    --color-surface: #1a1a1a; /* Superfícies de Cards */
    --color-text-light: #e0f7fa; /* Texto claro */
    --color-text-muted: #808080; /* Texto secundário */
    --font-family-primary: 'Orbitron', sans-serif; /* Fonte tecnológica */
    --font-family-secondary: 'Roboto', sans-serif; /* Fonte de leitura */
    --border-radius: 10px;
    --shadow-glow: 0 0 15px rgba(0, 234, 255, 0.7); /* Sombra de brilho primário */
    --shadow-glow-secondary: 0 0 10px rgba(255, 0, 119, 0.5); /* Sombra de brilho secundário */
}

/* Reset e estilos globais */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#splash-screen{
  position: fixed;
  inset: 0;                 /* top:0; right:0; bottom:0; left:0; */
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(29,78,216,0.04));
  z-index: 9999;
  transition: opacity .8s ease, visibility .8s;
}
#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.progress-spinner{
  display:inline-block;
  width:18px;
  height:18px;
  border:3px solid rgba(0,0,0,0.1);
  border-top-color: rgba(0,0,0,0.25);
  border-radius:50%;
  animation: spin 1s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }


body {
    font-family: var(--font-family-secondary);
    background-color: var(--color-background);
    color: var(--color-text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative; /* Para o fundo animado */
}

/* Scrollbar estilizada */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-thumb {
    background-color: var(--color-primary);
    border-radius: 4px;
}

body::-webkit-scrollbar-track {
    background-color: var(--color-surface);
}

/* Layout principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Títulos */
h1, h2, h3 {
    font-family: var(--font-family-primary);
    color: var(--color-primary);
    text-shadow: var(--shadow-glow);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--color-secondary);
}

/* Botões */
.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-background);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s, box-shadow 0.3s, transform 0.2s;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background-color: var(--color-secondary);
    box-shadow: var(--shadow-glow-secondary);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Cards e Superfícies */
.card {
    background-color: var(--color-surface);
    border: 1px solid rgba(0, 234, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 3rem;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), var(--shadow-glow);
}

.card-title {
    margin-bottom: 0.5rem;
}

.card-subtitle {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

/* Formulários */
.search-input {
    background-color: var(--color-background);
    border: 1px solid var(--color-primary);
    color: var(--color-text-light);
    padding: 0.75rem;
    border-radius: 8px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: var(--shadow-glow-secondary);
}

/* Estilos para o logo */
.logo-medorax {
    filter: drop-shadow(0 0 8px var(--color-primary));
    transition: all 0.5s;
}

/* Estilos para o fundo animado (Imagem médica com animação) */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    opacity: 0.1; /* Sutil */
    background-image: url('medorax_background.png');
    background-size: cover;
    background-position: center;
    animation: background-pan 60s linear infinite alternate; /* Movimento sutil */
}

@keyframes background-pan {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

/* Estilos para a Splash Screen */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-background);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 1s ease-out, visibility 1s ease-out;
}

.splash-logo-container {
    width: 150px; /* Tamanho do logo na splash */
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: pulse-glow 1.5s infinite alternate;
}

.splash-logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes pulse-glow {
    from {
        transform: scale(1);
        opacity: 0.8;
        filter: drop-shadow(0 0 10px var(--color-primary));
    }
    to {
        transform: scale(1.1);
        opacity: 1;
        filter: drop-shadow(0 0 30px var(--color-primary)) drop-shadow(0 0 10px var(--color-secondary));
    }
}

.splash-text {
    margin-top: 30px;
    font-family: var(--font-family-primary);
    font-size: 1.5rem;
    color: var(--color-text-light);
    opacity: 0;
    animation: fadeIn 0.8s 0.5s forwards;
}

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

.loading-bar {
    width: 300px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin-top: 20px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
    animation: load 2s ease-out forwards;
}

@keyframes load {
    0% { width: 0; }
    100% { width: 100%; }
}

/* Estilos para o cabeçalho */
header {
    background-color: rgba(26, 26, 26, 0.95); /* Superfície com transparência */
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.7);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 234, 255, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    width: 40px; /* Logo menor e discreto */
    height: 40px;
}

.project-title {
    font-family: var(--font-family-primary);
    font-size: 1.5rem;
    color: var(--color-primary);
    text-shadow: var(--shadow-glow);
    line-height: 1;
}

.project-subtitle {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    line-height: 1;
}

.main-nav a {
    margin-left: 20px;
    font-family: var(--font-family-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-secondary);
    transition: width 0.3s ease-in-out;
}

.main-nav a:hover::after {
    width: 100%;
}

/* Estilos para a seção Hero */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 80px 0;
    gap: 40px;
}

.hero-text {
    max-width: 600px;
}

.hero-text h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.lead-text {
    font-size: 1.1rem;
    color: var(--color-text-light);
    margin-bottom: 30px;
    line-height: 1.6;
}

.hero-visual {
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dna-pulse-animation {
    width: 100%;
    height: 100%;
    background-image: url('medorax_logo.png'); /* Usando o logo como base */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: dna-pulse 3s infinite alternate;
    filter: drop-shadow(0 0 20px var(--color-primary));
}

@keyframes dna-pulse {
    0% {
        transform: scale(0.95) rotate(0deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.05) rotate(5deg);
        opacity: 1;
    }
}

/* Estilos para a interface de análise */
.main-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .main-card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.dropzone {
    border: 2px dashed var(--color-primary);
    background-color: rgba(0, 234, 255, 0.05);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s;
    border-radius: var(--border-radius);
}

.dropzone:hover {
    border-color: var(--color-secondary);
    background-color: rgba(255, 0, 119, 0.05);
    box-shadow: var(--shadow-glow-secondary);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.icon-dna {
    font-size: 3rem;
    color: var(--color-primary);
    animation: float 4s infinite ease-in-out;
}

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

.preview-container {
    margin-bottom: 20px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.clear-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    transition: color 0.3s;
}

.clear-btn:hover {
    color: var(--color-secondary);
}

.preview-image-wrapper {
    overflow: hidden;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 234, 255, 0.3);
    box-shadow: var(--shadow-glow);
}

.preview-img {
    max-height: 300px;
    width: 100%;
    object-fit: contain;
    display: block;
}

.progress-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    color: var(--color-primary);
    font-family: var(--font-family-primary);
    font-size: 0.9rem;
}

.progress-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Resultados */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tag {
    background-color: var(--color-secondary);
    color: var(--color-background);
    padding: 0.3rem 0.7rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.result-item {
    background-color: rgba(0, 234, 255, 0.05);
    border: 1px solid rgba(0, 234, 255, 0.2);
    padding: 1rem;
    border-radius: 8px;
}

.result-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.result-value {
    font-family: var(--font-family-primary);
    font-weight: 700;
    color: var(--color-text-light);
}

.result-section-title {
    font-family: var(--font-family-primary);
    color: var(--color-secondary);
    font-size: 1.1rem;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 0, 119, 0.2);
    padding-bottom: 5px;
}

.result-list, .result-list-refs {
    list-style: none;
    padding-left: 20px;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.result-list li, .result-list-refs li {
    margin-bottom: 5px;
    position: relative;
}

.result-list li::before {
    content: '•';
    color: var(--color-primary);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.result-list-refs a {
    color: var(--color-primary);
}

.report-text {
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--color-text-light);
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Pesquisa Clínica */
.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-form .search-input {
    flex-grow: 1;
    min-width: 150px;
}

.site-input {
    flex-grow: 0.5;
}

.num-input {
    width: 80px;
    flex-grow: 0;
}

.search-button {
    flex-grow: 0;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-results .result-item {
    padding: 15px;
    border: 1px solid rgba(255, 0, 119, 0.1);
    background-color: rgba(255, 0, 119, 0.02);
    transition: background-color 0.3s;
}

.search-results .result-item:hover {
    background-color: rgba(255, 0, 119, 0.05);
}

.search-results a {
    color: var(--color-secondary);
    font-weight: 700;
    font-size: 1rem;
}

.search-results p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    word-break: break-all;
}

/* Documentação */
.documentation-card {
    margin-top: 3rem;
}

.doc-content {
    line-height: 1.6;
    color: var(--color-text-light);
}

.doc-content h3 {
    font-family: var(--font-family-primary);
    color: var(--color-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.doc-content h4 {
    font-family: var(--font-family-primary);
    color: var(--color-secondary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255, 0, 119, 0.3);
    padding-bottom: 5px;
}

.doc-content p {
    margin-bottom: 1rem;
}

.doc-content ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 1rem;
}

.doc-content pre {
    background-color: #000000;
    border: 1px solid rgba(0, 234, 255, 0.3);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    margin-top: 1rem;
    box-shadow: inset 0 0 10px rgba(0, 234, 255, 0.1);
}

/* Rodapé */
footer {
    margin-top: 50px;
    padding: 20px 0;
    border-top: 1px solid rgba(0, 234, 255, 0.1);
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    background-color: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(5px);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-credits {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.footer-credits a {
    color: var(--color-secondary);
    font-weight: 700;
}

.footer-disclaimer {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* Responsividade */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .main-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-nav a {
        margin: 0 10px;
    }

    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: 40px 0;
    }

    .hero-visual {
        margin-top: 30px;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form .search-input, .search-button {
        width: 100%;
    }
}
