/* Importando uma fonte para um visual mais moderno */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

/* Definindo variáveis de cores para os temas claro e escuro */
:root {
    --bg-color-light: #f4f4f9;
    --card-color-light: #ffffff;
    --text-color-light: #1a1a1a;
    --primary-color-light: #3a0ca3;
    --secondary-color-light: #4361ee;
    
    --bg-color-dark: #121212;
    --card-color-dark: #1e1e1e;
    --text-color-dark: #e0e0e0;
    --primary-color-dark: #7b2cbf;
    --secondary-color-dark: #4cc9f0;

    --font-family: 'Roboto', sans-serif;
}

/* Aplicando o tema escuro quando a classe 'dark-mode' está no body */
body.dark-mode {
    --bg-color: var(--bg-color-dark);
    --card-color: var(--card-color-dark);
    --text-color: var(--text-color-dark);
    --primary-color: var(--primary-color-dark);
    --secondary-color: var(--secondary-color-dark);
}

body {
    --bg-color: var(--bg-color-light);
    --card-color: var(--card-color-light);
    --text-color: var(--text-color-light);
    --primary-color: var(--primary-color-light);
    --secondary-color: var(--secondary-color-light);
    
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

.background-gif {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/home.gif');
    background-size: cover;
    background-position: center;
    z-index: -1;
    filter: brightness(0.4);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.logo {
    width: 300px;
}

nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-btn, .theme-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--secondary-color-dark);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.header-btn:hover, .theme-btn:hover {
    background: var(--secondary-color-dark);
    transform: translateY(-2px);
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin-top: 50px;
}

.login-card, .register-card {
    background: var(--card-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.5s ease-in-out;
}

.register-card.hidden {
    opacity: 0;
    transform: scale(0.9);
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    border: none;
}

h2, h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.input-group {
    text-align: left;
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
}

.action-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    width: 100%;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.action-btn:hover {
    background-color: var(--secondary-color);
}

.divider {
    margin: 20px 0;
    font-weight: bold;
}

.secondary-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-weight: bold;
    cursor: pointer;
}

.profile-options {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    margin-top: 20px;
}

.profile-btn {
    background-color: var(--bg-color);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.profile-btn i {
    font-size: 1.5rem;
}

.profile-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.battles-display {
    width: 100%;
    text-align: center;
}

.battles-display h2 {
    color: white;
    text-shadow: 2px 2px 4px #000;
}

.battles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Estilo para prévia da imagem de avatar/logo no CADASTRO */
.image-preview-container {
    margin: 15px auto;
    width: 120px;
    height: 120px;
}

.image-preview {
    width: 120px;
    height: 120px;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    object-fit: cover;
    display: none;
}

.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    cursor: pointer;
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    margin-top: 10px;
}

.upload-btn-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

/* Estilos para notificações (sucesso, erro) */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s ease-in-out;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success { background-color: #28a745; }
.notification.error { background-color: #dc3545; }

/* Animação de 'carregando' para o botão */
.action-btn.loading {
    position: relative;
    color: transparent;
}
.action-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }