/* =====================================================================
   MonCorp — Estilos Globais
   ===================================================================== */

:root {
    --bg-dark: #1e272e;
    --bg-card: #2c3e50;
    --bg-input: #34495e;
    --primary: #0fb9b1;
    --primary-hover: #2bcbba;
    --text-light: #d2dae2;
    --text-muted: #808e9b;
    --border-soft: rgba(255, 255, 255, 0.06);
    --shadow-card: 0 8px 20px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 12px 30px rgba(15, 185, 177, 0.18);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    display: flex;
    min-height: 100vh;
}

/* =========================
   SIDEBAR
   ========================= */
.sidebar {
    width: 250px;
    background-color: var(--bg-card);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-right: 2px solid var(--bg-input);
}

.sidebar h2 {
    color: var(--primary);
    font-size: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary);
    color: #fff;
}

/* =========================
   MAIN CONTENT
   ========================= */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

header {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header-text h1 {
    font-size: 24px;
    color: #fff;
}

.header-text p {
    color: var(--text-muted);
    margin-top: 5px;
    font-size: 14px;
}

/* =========================
   BOTÕES AUTH
   ========================= */
.auth-buttons {
    display: flex;
    gap: 15px;
}

.btn-outline {
    padding: 10px 20px;
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: var(--transition);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: var(--bg-dark);
}

.btn-solid {
    padding: 10px 20px;
    background-color: var(--primary);
    color: var(--bg-dark);
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: var(--transition);
}

.btn-solid:hover {
    background-color: var(--primary-hover);
}

/* =========================
   CARDS GENÉRICOS
   ========================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background-color: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border-top: 4px solid var(--primary);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card h3 {
    color: var(--text-muted);
    font-size: 14px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.card .valor {
    font-size: 32px;
    font-weight: bold;
    color: #fff;
}

/* =========================
   TÍTULOS DE SEÇÃO
   ========================= */
.section-title {
    font-size: 22px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--bg-input);
    padding-bottom: 10px;
    color: #fff;
}

/* =========================
   FORMULÁRIOS
   ========================= */
.form-medidas {
    display: flex;
    gap: 15px;
    background-color: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-card);
}

.form-vertical label {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-light);
}

.form-vertical input,
.form-vertical select {
    padding: 14px;
    font-size: 15px;
    border-radius: 8px;
    border: 1px solid var(--bg-input);
    background-color: var(--bg-input);
    color: #fff;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.form-vertical input:focus,
.form-vertical select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 185, 177, 0.15);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 150px;
}

.input-group label {
    font-size: 14px;
    color: var(--text-light);
}

.input-group input {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--bg-input);
    background-color: var(--bg-input);
    color: #fff;
    outline: none;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary);
}

button.btn-salvar {
    background-color: var(--primary);
    color: #fff;
    padding: 14px 25px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    font-size: 15px;
}

button.btn-salvar:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(15, 185, 177, 0.35);
}

/* =========================
   ÁREA IMC (index.php)
   ========================= */
.area-imc {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 40px;
}

.area-imc .section-title {
    text-align: center;
    border-bottom: none;
    margin-bottom: 10px;
    font-size: 28px;
}

.area-imc .section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary);
    margin: 10px auto 0;
    border-radius: 2px;
}

.resultado-imc {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 500px;
    margin-top: 30px;
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    border-top: 4px solid var(--primary);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    animation: aparecer 0.5s ease-out;
}

.resultado-imc h3 {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
}

.resultado-imc .valor-imc {
    font-size: 56px;
    font-weight: 900;
    color: #fff;
    margin: 10px 0;
}

@keyframes aparecer {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================
   HISTÓRICO (avaliacao.php)
   ========================= */
.historico-container {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    margin-top: 20px;
}

.historico-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    color: var(--text-light);
}

.historico-table th,
.historico-table td {
    padding: 14px;
    text-align: center;
    border-bottom: 1px solid var(--bg-input);
}

.historico-table th {
    background-color: var(--primary);
    color: white;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.historico-table tr {
    transition: var(--transition);
}

.historico-table tbody tr:hover {
    background-color: rgba(15, 185, 177, 0.06);
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    display: inline-block;
}

/* =========================
   MENSAGENS DE BLOQUEIO
   ========================= */
.msg-bloqueio {
    text-align: center;
    background: var(--bg-card);
    padding: 50px;
    border-radius: var(--radius);
    margin-top: 50px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-soft);
}

.msg-bloqueio h2 {
    color: #ff4757;
    margin-bottom: 15px;
}

.msg-bloqueio a {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: bold;
    transition: var(--transition);
}

.msg-bloqueio a:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* =========================
   PROFILE DROPDOWN (GLOBAL)
   ========================= */
.profile-container {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
}

.profile-pic {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    user-select: none;
}

.profile-pic:hover {
    border-color: white;
    transform: scale(1.05);
}

.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 55px;
    width: 240px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    padding: 15px;
    border: 1px solid var(--bg-input);
}

.profile-dropdown.active {
    display: block;
    animation: aparecer 0.25s ease-out;
}

.dropdown-header {
    border-bottom: 1px solid var(--bg-input);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.dropdown-header h4 {
    margin: 0;
    color: var(--primary);
}

.dropdown-header small {
    color: var(--text-muted);
}

.dropdown-item {
    padding: 10px 0;
    color: var(--text-light);
    text-decoration: none;
    display: block;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
    transition: var(--transition);
}

.dropdown-item:hover {
    color: var(--primary);
    padding-left: 4px;
}

.btn-logout {
    background: #ff4757;
    color: white;
    border: none;
    padding: 10px;
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 12px;
    font-weight: bold;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #ff6b81;
}

/* =========================
   RESPONSIVO
   ========================= */
@media (max-width: 900px) {
    body {
        flex-direction: column;
        min-height: auto;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        padding: 12px 15px;
        gap: 8px;
        border-right: none;
        border-bottom: 2px solid var(--bg-input);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .sidebar h2 {
        font-size: 16px;
        margin-bottom: 0;
        margin-right: 8px;
        flex-shrink: 0;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
        flex-shrink: 0;
    }

    .main-content {
        padding: 20px 15px;
        overflow-y: visible;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 25px;
    }

    .header-text h1 {
        font-size: 18px;
    }

    .profile-container {
        position: static;
        align-self: flex-end;
    }

    .profile-dropdown {
        right: 0;
        left: auto;
        width: min(240px, calc(100vw - 30px));
    }

    .auth-buttons {
        width: 100%;
        justify-content: flex-end;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-medidas,
    .form-vertical {
        max-width: 100%;
        width: 100%;
    }

    .resultado-imc .valor-imc {
        font-size: 42px;
    }
}

@media (max-width: 480px) {
    .sidebar h2 {
        display: none;
    }

    .nav-link {
        padding: 8px 10px;
        font-size: 12px;
    }

    .card .valor {
        font-size: 26px;
    }

    .resultado-imc .valor-imc {
        font-size: 34px;
    }

    .historico-table th,
    .historico-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 500px;
}