:root {
    --bg-color: #05080f;
    --card-bg: #0b111e;
    --card-hover: #101a2e;
    --accent-blue: #4a90e2;
    --accent-glow: #2a6bb5;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: rgba(74, 144, 226, 0.2);
    --success-color: #10b981;
    --warning-color: #d39e00;
    --error-color: #ef4444;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, .brand-font {
    font-family: 'Cinzel', serif;
}

code, .mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(5, 8, 15, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 5%;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-container img {
    height: 130px;
    object-fit: contain;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover, nav a.active {
    color: var(--accent-blue);
}

.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #fff;
}

.cta-btn {
    background: linear-gradient(135deg, #2a6bb5, #4a90e2);
    color: #fff;
    padding: 0.55rem 1.4rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(74, 144, 226, 0.6);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 0.55rem 1.4rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.3s, color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-outline:hover {
    background: rgba(74, 144, 226, 0.1);
    color: #fff;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1rem;
    background: radial-gradient(circle at center, #0d1b32 0%, var(--bg-color) 75%);
}

.hero-content {
    max-width: 850px;
    z-index: 2;
}

.hero-content h1 {
    font-size: 2.6rem;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
    color: #fff;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Sections General */
section {
    padding: 6rem 8% 4rem 8%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.section-title {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-title h2 {
    font-size: 2.2rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Specialized Topics Grid */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
}

.topic-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2.5rem 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-blue);
    opacity: 0;
    transition: opacity 0.3s;
}

.topic-card:hover {
    transform: translateY(-5px);
    background: var(--card-hover);
    border-color: var(--accent-blue);
}

.topic-card:hover::before {
    opacity: 1;
}

.topic-card .icon-wrapper {
    font-size: 2.2rem;
    color: var(--accent-blue);
    margin-bottom: 1.2rem;
}

.topic-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.8rem;
    color: #fff;
}

.topic-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
}

/* ajuste foto*/
/* Correção do dimensionamento e alinhamento na secção Sobre */
.about-content {
    display: grid;
    grid-template-columns: 320px 1fr; /* Define uma largura fixa menor para a coluna da foto */
    gap: 3rem;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

.about-img-box {
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-img-box img {
    width: 100%;
    max-width: 260px;       /* Reduz o tamanho máximo para um aspeto mais proporcional */
    height: auto;           /* Mantém a proporção correta da fotografia */
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    object-fit: cover;
}

/* Ajuste para dispositivos móveis */
@media (max-width: 950px) {
    .about-content {
        grid-template-columns: 1fr; /* Empilha a imagem e o texto em ecrãs menores */
        gap: 2rem;
    }
    
    .about-img-box img {
        max-width: 220px; /* Imagem ligeiramente menor em telemóveis */
    }
}

/* ajuste foto*/
.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1.2rem;
    color: #fff;
}

.about-text p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.1rem;
    font-size: 1.1rem;
    text-align: justify;
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
}

.info-item i {
    font-size: 1.4rem;
    color: var(--accent-blue);
    margin-top: 0.2rem;
}

.info-item h4 {
    color: #fff;
    margin-bottom: 0.2rem;
    font-size: 1.05rem;
}

.info-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.contact-form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-group input, .form-group textarea {
    background: rgba(5, 8, 15, 0.6);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 4px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Upload & Analysis Specifics */
main {
    flex: 1;
    padding-top: 150px;
    padding-bottom: 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #0d1b32 0%, var(--bg-color) 80%);
}

.container {
    width: 100%;
    max-width: 1100px;
    padding: 0 1.5rem;
}

.upload-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3rem 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.drop-zone {
    border: 2px dashed var(--accent-blue);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(5, 8, 15, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover, .drop-zone.dragover {
    background: rgba(74, 144, 226, 0.08);
    border-color: #fff;
    transform: scale(1.005);
}

.drop-zone i {
    font-size: 3.5rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

.file-details {
    margin-top: 1.5rem;
    background: rgba(11, 17, 30, 0.9);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 6px;
    display: none;
    align-items: center;
    justify-content: space-between;
}

.terms-container {
    margin-top: 1.5rem;
    background: rgba(11, 17, 30, 0.5);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.terms-container input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.terms-container label {
    cursor: pointer;
    line-height: 1.4;
}

.terms-container a {
    color: var(--accent-blue);
    text-decoration: underline;
}

.form-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

#loading-spinner {
    display: none;
    text-align: center;
    margin-top: 2rem;
}

.spinner {
    border: 4px solid rgba(74, 144, 226, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: var(--accent-blue);
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

#result-box {
    display: none;
    margin-top: 2.5rem;
    background: #05080f;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
}

.tabs-nav {
    display: flex;
    gap: 0.4rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    width: 100%;
}

.tab-btn {
    background: rgba(11, 17, 30, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex: 1;
    white-space: nowrap;
    text-align: center;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(74, 144, 226, 0.1);
}

.tab-btn.active {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
    font-weight: 600;
}

.tab-content {
    display: none;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 768px) {
    .dashboard-grid { grid-template-columns: repeat(5, 1fr); }
}

.dash-card {
    background: rgba(11, 17, 30, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dash-card h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.dash-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.probative-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1rem;
}
.badge-alto { background: rgba(16, 185, 129, 0.15); color: var(--success-color); border: 1px solid var(--success-color); }
.badge-medio { background: rgba(211, 158, 0, 0.15); color: var(--warning-color); border: 1px solid var(--warning-color); }
.badge-baixo { background: rgba(239, 68, 68, 0.15); color: var(--error-color); border: 1px solid var(--error-color); }

.legend-container {
    background: rgba(11, 17, 30, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.2rem;
    margin-top: 1rem;
}

.legend-container h4 {
    color: var(--accent-blue);
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.legend-item {
    background: #03050a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.8rem;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.legend-item strong {
    color: #fff;
    display: block;
    margin-bottom: 0.3rem;
}

.signatures-container, .anomalies-container, .characteristics-container, .meta-section {
    background: rgba(11, 17, 30, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.signatures-container h4, .anomalies-container h4, .characteristics-container h4, .meta-section h4 {
    color: var(--accent-blue);
    font-size: 1rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sig-item {
    background: #03050a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.9rem;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    border-left: 3px solid var(--accent-blue);
}

.anomalies-container {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.3);
}
.anomalies-container h4 { color: var(--error-color); }

.characteristics-container {
    background: rgba(74, 144, 226, 0.05);
    border-color: rgba(74, 144, 226, 0.3);
}
.characteristics-container h4 { color: var(--accent-blue); }

.anomaly-list, .characteristic-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.anomaly-item {
    font-size: 0.9rem;
    color: #fca5a5;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.characteristic-item {
    font-size: 0.9rem;
    color: #93c5fd;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.no-anomalies {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1.2rem;
    border-radius: 6px;
    color: var(--success-color);
    font-size: 0.95rem;
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.hash-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #03050a;
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.3rem;
}

.hash-box {
    font-size: 0.8rem;
    word-break: break-all;
    color: #38bdf8;
}

.copy-btn {
    background: rgba(74, 144, 226, 0.15);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--accent-blue);
    color: #fff;
}

.xmp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.xmp-item {
    background: #03050a;
    padding: 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
}

.xmp-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.xmp-val {
    color: #fff;
    margin-top: 0.2rem;
    word-break: break-all;
}

/* Footer */
footer {
    background: #03050a;
    padding: 2.5rem 8%;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

footer p {
    margin-bottom: 0.4rem;
}

@media (max-width: 950px) {
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(5, 8, 15, 0.98);
        padding: 1.5rem 0;
        border-bottom: 1px solid var(--border-color);
        gap: 1rem;
        text-align: center;
    }
    nav ul.active {
        display: flex;
    }
    .menu-toggle {
        display: block;
    }
    .about-content, .contact-container {
        grid-template-columns: 1fr;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
}