/* --- ESTILOS MESCLADOS DOS DOIS ARQUIVOS HTML --- */

:root {
    --primary-color: #00498f;
    --secondary-color: #1e88e5;
    /* O caminho da imagem de fundo é relativo ao arquivo CSS */
    --bg-blur: url('../images/wallpaper.png');
    --white: #fff;
    --gray: #f4f4f4;
    --text: #333;
    --font-title: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    
    color-scheme: light dark;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--gray);
    color: var(--text);
    position: relative;
    overflow-x: hidden;
    background-image: var(--bg-blur);
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: var(--bg-blur);
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    filter: blur(8px);
    z-index: -1;
    transition: background-image 0.5s ease-in-out;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 0 20px;
}

header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
}

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

.logo img {
    height: 50px;
    display: block;
}

.theme-button, .header-spacer {
    width: 44px;
    height: 44px;
}

.theme-button {
    background: rgba(0, 73, 143, 0.1);
    border: 1px solid rgba(0, 73, 143, 0.2);
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: background-color 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.theme-button:hover {
    transform: scale(1.1);
    background: rgba(0, 73, 143, 0.2);
}
.theme-button svg {
    width: 24px;
    height: 24px;
    transition: color 0.3s ease;
}
.theme-button .sun { color: var(--primary-color); display: block; }
.theme-button .moon { color: var(--secondary-color); display: none; }

main {
    padding: 40px 0;
    margin-bottom: 60px;
}

.section-title {
    font-family: var(--font-title);
    font-size: 2.2rem;
    color: var(--white);
    text-align: center;
    margin-bottom: 40px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.card {
    width: 260px;
    height: 320px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
    backdrop-filter: blur(2px);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-image-wrapper {
    height: 60%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.card h3 {
    font-family: var(--font-title);
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.btn {
    padding: 10px 16px;
    border-radius: 30px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-family: var(--font-title);
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 30px 0;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- TEMA ESCURO --- */
body.dark-theme {
    --gray: #121212;
    --text: #e0e0e0;
}
body.dark-theme::before {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), var(--bg-blur);
}
body.dark-theme header {
    background: rgba(18, 18, 18, 0.7);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
body.dark-theme .logo img {
    filter: invert(1) hue-rotate(180deg);
}

/* Regra específica do segundo arquivo para inverter imagens no tema escuro */
body.dark-theme .card-dark {
    filter: brightness(0) invert(1);
}

body.dark-theme .theme-button {
    background: rgba(30, 136, 229, 0.1);
    border-color: rgba(30, 136, 229, 0.2);
}
body.dark-theme .theme-button:hover {
     background: rgba(30, 136, 229, 0.25);
}
body.dark-theme .theme-button .sun { display: none; }
body.dark-theme .theme-button .moon { display: block; }

body.dark-theme .card {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid #444;
    color: var(--text);
}
body.dark-theme .card h3 {
    color: var(--secondary-color);
}
body.dark-theme .card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}
body.dark-theme footer {
    background: #111;
    color: #aaa;
}

/* --- MEDIA QUERIES --- */
@media(max-width: 600px) {
    .section-title { font-size: 1.8rem; }
    .card { 
        height: 300px; 
        width: 240px;
    }
    .card h3 { font-size: 1.1rem; }
}