/* ============================================
   FITZONE - ESTILOS PRINCIPAIS
   Paleta: Dark Azul Puro
   ============================================ */

:root {
    /* Modo Escuro (Padrão) - Dark Azul */
    --primary-dark: #0d1b2a;
    --secondary-dark: #1a2f4a;
    --tertiary-dark: #2d4563;
    --light-blue: #00d4ff;
    --accent-blue: #0066cc;
    --text-white: #ffffff;
    --text-gray: #b0b5c0;
    --text-light: #d0d5e0;
    --shadow: rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
    
    /* Variáveis de Tema */
    --bg-primary: var(--primary-dark);
    --bg-secondary: var(--secondary-dark);
    --bg-tertiary: var(--tertiary-dark);
    --text-primary: var(--text-white);
    --text-secondary: var(--text-gray);
    --border-color: rgba(0, 212, 255, 0.1);
}

/* Modo Claro */
body.light-mode {
    --primary-dark: #f5f7fa;
    --secondary-dark: #ffffff;
    --tertiary-dark: #e8ecf1;
    --light-blue: #0066cc;
    --accent-blue: #00a8e8;
    --text-white: #1a2332;
    --text-gray: #5a6b7a;
    --text-light: #3a4b5a;
    --shadow: rgba(0, 0, 0, 0.08);
    
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8ecf1;
    --text-primary: #1a2332;
    --text-secondary: #5a6b7a;
    --border-color: rgba(0, 102, 204, 0.1);
}

/* ============================================
   RESET E ESTILOS GLOBAIS
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
}

/* ============================================
   HEADER E NAVBAR
   ============================================ */

header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
    box-shadow: 0 4px 20px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.logo-img {
    width: 40px;
    height: 40px;
    transition: var(--transition);
}

.logo-container:hover .logo-img {
    transform: scale(1.1);
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--light-blue);
    text-decoration: none;
    transition: var(--transition);
    letter-spacing: 2px;
}

.logo:hover {
    color: var(--text-white);
    text-shadow: 0 0 20px var(--light-blue);
}

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

.nav-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    position: relative;
}

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

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--light-blue);
}

.btn-login {
    background: var(--accent-blue);
    color: var(--text-white) !important;
    padding: 0.6rem 1.5rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-login:hover {
    background: var(--light-blue);
    color: var(--text-white) !important;
    box-shadow: 0 0 20px var(--light-blue);
    text-shadow: none;
    transform: translateY(-2px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--light-blue);
    font-weight: 600;
}

.btn-logout {
    background: #d32f2f;
    color: var(--text-white);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.btn-logout:hover {
    background: #ff5252;
    box-shadow: 0 0 15px rgba(255, 82, 82, 0.5);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--light-blue);
    border-radius: 2px;
    transition: var(--transition);
}

/* ============================================
   MAIN E CONTAINER
   ============================================ */

main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

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

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--tertiary-dark) 100%);
    border-radius: 1rem;
    margin-bottom: 3rem;
    box-shadow: 0 8px 32px var(--shadow);
    animation: fadeIn 0.6s ease;
}

.hero h1 {
    font-size: 3rem;
    color: var(--light-blue);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px var(--light-blue);
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-light);
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
    margin-bottom: 4rem;
    animation: fadeIn 0.6s ease;
}

.section h2 {
    font-size: 2.2rem;
    color: var(--light-blue);
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 0 0 15px var(--light-blue);
}

.section h3 {
    color: var(--light-blue);
    margin-bottom: 1rem;
}

/* ============================================
   CARDS
   ============================================ */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.card {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--tertiary-dark) 100%);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--accent-blue);
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--shadow);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px var(--shadow);
    border-color: var(--light-blue);
}

.card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--light-blue);
}

.card p {
    color: var(--text-gray);
    line-height: 1.8;
}

/* ============================================
   BOTÕES
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    min-width: 150px;
    text-align: center;
}

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    margin-top: 1.5rem;
}

.btn-group .btn {
    flex: 1;
    min-width: 150px;
}

.btn-primary {
    background: var(--accent-blue);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--light-blue);
    color: var(--primary-dark);
    box-shadow: 0 0 20px var(--light-blue);
    transform: translateY(-2px);
}

.btn-submit {
    background: var(--accent-blue);
    color: var(--text-white);
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    font-size: 1rem;
}

.btn-submit:hover {
    background: var(--light-blue);
    color: var(--primary-dark);
    box-shadow: 0 0 20px var(--light-blue);
}

.btn-submit:disabled {
    background: var(--text-gray);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================
   FORMULÁRIOS
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--light-blue);
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    background: var(--tertiary-dark);
    border: 1px solid var(--accent-blue);
    border-radius: 0.5rem;
    color: var(--text-white);
    font-family: inherit;
    transition: var(--transition);
}

.form-group select option {
    background: var(--secondary-dark);
    color: var(--text-white);
}

/* Seta azul apenas para selects com classe 'com-seta' */
.form-group select.com-seta {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2300d4ff" stroke-width="2"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 1.2em;
    padding-right: 2.5rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--light-blue);
    box-shadow: 0 0 10px var(--light-blue);
    background: var(--tertiary-dark);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ============================================
   ALERTAS
   ============================================ */

.alert {
    padding: 1.2rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-info {
    background: rgba(0, 102, 204, 0.2);
    border-color: var(--accent-blue);
    color: var(--light-blue);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
    color: #ffc107;
}

.alert-success {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4caf50;
    color: #4caf50;
}

.alert-error {
    background: rgba(211, 47, 47, 0.2);
    border-color: #d32f2f;
    color: #ff5252;
}

/* ============================================
   BREADCRUMB
   ============================================ */

.breadcrumb {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: var(--text-gray);
}

.breadcrumb a {
    color: var(--light-blue);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--text-white);
    text-decoration: underline;
}

/* ============================================
   HORÁRIOS
   ============================================ */

.horarios-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.horario-item {
    background: var(--tertiary-dark);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--accent-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.horario-item:hover {
    border-color: var(--light-blue);
    box-shadow: 0 4px 15px var(--shadow);
}

.horario-info {
    flex: 1;
}

.horario-dia {
    font-weight: 600;
    color: var(--light-blue);
    margin-bottom: 0.5rem;
}

.horario-hora {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--secondary-dark);
    padding: 2rem;
    border-radius: 1rem;
    border: 2px solid var(--accent-blue);
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px var(--shadow);
    position: relative;
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--light-blue);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-white);
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
    color: var(--text-gray);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--accent-blue);
}

/* ============================================
   ANIMAÇÕES
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 768px) {
    nav {
        padding: 1rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--secondary-dark);
        padding: 1rem;
        gap: 1rem;
        border-bottom: 2px solid var(--accent-blue);
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 1rem;
    }

    .section h2 {
        font-size: 1.8rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.4rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   PERFIL DO UTILIZADOR
   ============================================ */

.profile-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.profile-sidebar {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--tertiary-dark) 100%);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--accent-blue);
    height: fit-content;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    background: var(--accent-blue);
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.profile-info h2 {
    color: var(--light-blue);
    margin-bottom: 1rem;
    text-align: center;
}

.profile-info p {
    color: var(--text-gray);
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.profile-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-section {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--tertiary-dark) 100%);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--accent-blue);
}

.profile-section h3 {
    color: var(--light-blue);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.imc-calculator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.imc-result {
    background: var(--tertiary-dark);
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 2px solid var(--accent-blue);
}

.imc-value {
    font-size: 2rem;
    color: var(--light-blue);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.imc-category {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.treinos-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.treino-item {
    background: var(--tertiary-dark);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--light-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.treino-info h4 {
    color: var(--light-blue);
    margin-bottom: 0.3rem;
}

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

.treino-data {
    color: var(--text-gray);
    font-size: 0.85rem;
}

.btn-delete {
    background: #d32f2f;
    color: var(--text-white);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 0.3rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.btn-delete:hover {
    background: #ff5252;
}

@media (max-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr;
    }

    .imc-calculator {
        grid-template-columns: 1fr;
    }

    .treino-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Estilos para textarea */
textarea {
    width: 100%;
    padding: 0.8rem;
    background: var(--tertiary-dark);
    border: 1px solid var(--accent-blue);
    border-radius: 0.5rem;
    color: var(--text-white);
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

textarea:focus {
    outline: none;
    border-color: var(--light-blue);
    box-shadow: 0 0 10px var(--light-blue);
}


/* ============================================
   BOTÃO DE TEMA (ESCURO/CLARO)
   ============================================ */

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--tertiary-dark);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--secondary-dark);
    border-color: var(--light-blue);
}

.theme-toggle span {
    font-size: 1.2rem;
}

.theme-toggle-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: none;
}

@media (min-width: 768px) {
    .theme-toggle-label {
        display: inline;
    }
}

/* ============================================
   AJUSTES PARA MODO CLARO
   ============================================ */

body.light-mode header {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.light-mode .logo {
    color: #0066cc;
}

body.light-mode .logo:hover {
    color: #1a2332;
    text-shadow: 0 0 20px rgba(0, 102, 204, 0.3);
}

body.light-mode .nav-links a {
    color: #5a6b7a;
}

body.light-mode .nav-links a:hover,
body.light-mode .nav-links a.active {
    color: #0066cc;
}

body.light-mode .btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #00a8e8 100%);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
}

body.light-mode .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3);
}

body.light-mode .card {
    background: #ffffff;
    border: 1px solid #e8ecf1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.light-mode .card:hover {
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.1);
}

body.light-mode .card h3 {
    color: #1a2332;
}

body.light-mode .card p {
    color: #5a6b7a;
}

body.light-mode .section {
    background: transparent;
}

body.light-mode .section h2 {
    color: #1a2332;
}

body.light-mode .section p {
    color: #5a6b7a;
}

body.light-mode input,
body.light-mode select,
body.light-mode textarea {
    background: #ffffff;
    color: #1a2332;
    border: 1px solid #e8ecf1;
}

body.light-mode input:focus,
body.light-mode select:focus,
body.light-mode textarea:focus {
    border-color: #0066cc;
    box-shadow: 0 0 10px rgba(0, 102, 204, 0.2);
    background: #ffffff;
}

body.light-mode .modal-content {
    background: #ffffff;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

body.light-mode .modal-content h2 {
    color: #1a2332;
}

body.light-mode .form-group label {
    color: #1a2332;
}

body.light-mode footer {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    color: #5a6b7a;
    border-top: 1px solid #e8ecf1;
}

body.light-mode .breadcrumb a {
    color: #0066cc;
}

body.light-mode .breadcrumb a:hover {
    color: #00a8e8;
}

body.light-mode .alert {
    background: #e3f2fd;
    color: #1a2332;
    border: 1px solid #90caf9;
}

body.light-mode .alert-warning {
    background: #fff3e0;
    border-color: #ffe0b2;
    color: #e65100;
}

body.light-mode .user-info {
    background: #f5f7fa;
    border: 1px solid #e8ecf1;
}

body.light-mode .btn-logout {
    background: #d32f2f;
    color: #ffffff;
}

body.light-mode .btn-logout:hover {
    background: #ff5252;
}

body.light-mode .profile-section {
    background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
    border: 1px solid #e8ecf1;
}

body.light-mode .profile-section h3 {
    color: #0066cc;
}

body.light-mode .imc-result {
    background: #f5f7fa;
    border: 2px solid #0066cc;
}

body.light-mode .imc-value {
    color: #0066cc;
}

body.light-mode .imc-category {
    color: #5a6b7a;
}

body.light-mode .treino-item {
    background: #f5f7fa;
    border-left-color: #0066cc;
}

body.light-mode .treino-item h4 {
    color: #0066cc;
}

body.light-mode .treino-item p {
    color: #5a6b7a;
}

body.light-mode .horario-item {
    background: #f5f7fa;
    border: 1px solid #e8ecf1;
}

body.light-mode .horario-dia {
    color: #1a2332;
}

body.light-mode .horario-hora {
    color: #0066cc;
}

body.light-mode .cards-grid .card {
    background: #ffffff;
}

body.light-mode .hero {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}

body.light-mode .hero h1 {
    color: #1a2332;
}

body.light-mode .hero p {
    color: #5a6b7a;
}
