:root {
    /* Paleta de Cores - Soft Professional Dark (Slate Palette) */
    --bg-main: #0f172a;        /* Slate 900 */
    --bg-card: #1e293b;        /* Slate 800 */
    --bg-input: #334155;       /* Slate 700 */
    --bg-input-focus: #475569; /* Slate 600 */
    --accent: #38bdf8;         /* Sky 400 (Mais suave que o cyan puro) */
    --accent-hover: #7dd3fc;   /* Sky 300 */
    --accent-glow: rgba(56, 189, 248, 0.2);
    --text-main: #f1f5f9;      /* Slate 100 */
    --text-muted: #e2e8f0;     /* Slate 200 - Muito mais visível */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-light: rgba(255, 255, 255, 0.1);
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Arredondamentos - Padronizados e Modernos */
    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    /* Efeitos - Profundidade e Glassmorphism */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-accent: 0 0 15px rgba(56, 189, 248, 0.15);
    --glass: rgba(30, 41, 59, 0.7); /* Slate 800 with transparency */
    --glass-blur: blur(16px);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Dimensões */
    --sidebar-width: 280px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    line-height: 1.6;
}

.text-muted, .text-white-50 { 
    color: var(--text-muted) !important; 
}

.opacity-50 {
    opacity: 0.75 !important; /* Aumentando a opacidade de 0.5 para 0.75 para melhor leitura */
}

/* Layout */
.sidebar { 
    background-color: var(--glass); 
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    height: 100vh; 
    border-right: 1px solid var(--border-color); 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: var(--sidebar-width); 
    z-index: 1000; 
    transition: var(--transition); 
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color-light);
    border-radius: 10px;
}

.main-content { 
    margin-left: var(--sidebar-width); 
    padding: 3rem; 
    min-height: 100vh; 
    width: calc(100% - var(--sidebar-width)); 
    transition: var(--transition); 
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.03), transparent 40%),
                radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.02), transparent 40%);
    animation: fadeIn 0.4s ease-out;
}

/* Sidebar Colapsada */
body.sidebar-collapsed .sidebar { transform: translateX(calc(var(--sidebar-width) * -1)); }
body.sidebar-collapsed .main-content { margin-left: 0; width: 100%; }

/* Sidebar Collapsed Adjustments */
body.sidebar-collapsed .profile-img-nav {
    width: 35px;
    height: 35px;
}

body.sidebar-collapsed .sidebar .px-4.mb-5,
body.sidebar-collapsed .sidebar .px-4.mb-4 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

body.sidebar-collapsed .sidebar .p-3.rounded-4 {
    padding: 0.5rem !important;
}

body.sidebar-collapsed .sidebar h3,
body.sidebar-collapsed .sidebar small,
body.sidebar-collapsed .sidebar .ms-3,
body.sidebar-collapsed .sidebar .nav-item.small {
    display: none;
}

body.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    padding: 0.8rem;
}

body.sidebar-collapsed .sidebar .nav-link i {
    margin-right: 0;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards Modernos */
.card-aluno, .card-treino, .card-avaliacao, .card-custom, .card { 
    background: var(--bg-card); 
    border-radius: var(--radius-lg); 
    padding: 1.5rem; 
    border: 1px solid var(--border-color); 
    margin-bottom: 1.5rem; 
    position: relative; 
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.card-aluno:hover, .card-avaliacao:hover, .card-treino:hover, .card:hover { 
    border-color: rgba(56, 189, 248, 0.3); 
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-accent);
}

/* Inputs Modernos */
.form-control, .form-select { 
    background-color: var(--bg-input) !important; 
    border: 1px solid var(--border-color-light) !important; 
    color: var(--text-main) !important; 
    border-radius: var(--radius-md) !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
    transition: var(--transition) !important;
    box-shadow: none !important;
}

.form-control:focus, .form-select:focus { 
    background-color: var(--bg-input-focus) !important; 
    border-color: var(--accent) !important; 
    box-shadow: 0 0 0 4px var(--accent-glow) !important; 
}

.form-control::placeholder { 
    color: var(--text-muted); 
}

select.form-select option { 
    background-color: var(--bg-card); 
    color: var(--text-main); 
}

/* Efeitos de Vidro (Glassmorphism) */
.glass-card {
    background: var(--glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.glass-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--border-color-light);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Utilitários de Texto */
.text-gradient {
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Estilo para a imagem de perfil na navegação (ajustado) */
.profile-img-nav { 
    width: 45px; 
    height: 45px; 
    object-fit: cover; 
    border: 2px solid var(--accent); 
    padding: 2px;
    background: var(--bg-main);
    transition: var(--transition);
}

.profile-img-nav:hover {
    transform: scale(1.05) rotate(5deg); 
}

.profile-img-list { 
    width: 48px; 
    height: 48px; 
    object-fit: cover; 
    border: 2px solid var(--accent); 
    border-radius: 50%;
}

/* Cores Utilitárias */
.text-info-custom { color: var(--accent); }
.bg-dark-custom { background: rgba(0, 0, 0, 0.4); }

/* Treino Specifics */
.serie-dot { 
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    border: 2px solid var(--accent); 
    background: transparent; 
    color: var(--accent); 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    margin-right: 8px; 
    cursor: pointer; 
    font-weight: bold; 
    transition: 0.2s; 
    font-size: 1.1rem; 
}

.serie-dot.active { 
    background: var(--accent); 
    color: var(--bg-main); 
}

.card-treino.concluido { 
    opacity: 0.6; 
    border-color: var(--success); 
}

.card-treino.concluido::after { 
    content: ""; position: absolute; top: 50%; left: 0; width: 100%; height: 2px; 
    background: rgba(40, 167, 69, 0.6); z-index: 10; transform: translateY(-50%); 
    pointer-events: none;
}

.card-treino.concluido .flex-grow-1, .card-treino.concluido .exercise-visual { 
    filter: grayscale(0.8);
}

/* Tabelas Customizadas */
.table-custom { 
    color: var(--text-main); 
    border-collapse: separate; 
    border-spacing: 0 12px; 
    width: 100%;
}

.table-custom thead th { 
    border: none; 
    color: var(--text-muted); 
    font-size: 0.8rem; 
    font-weight: 700;
    text-transform: uppercase; 
    letter-spacing: 1.2px; 
    padding: 0 1.5rem 0.5rem; 
}

.table-custom tbody tr { 
    background: var(--bg-card); 
    transition: var(--transition); 
    box-shadow: var(--shadow-sm);
}

.table-custom tbody tr:hover { 
    transform: scale(1.015); 
    background: #27354a;
    box-shadow: var(--shadow-lg);
}

.table-custom tbody td { 
    border-top: 1px solid var(--border-color); 
    border-bottom: 1px solid var(--border-color); 
    padding: 1.25rem 1.5rem; 
}

.table-custom tbody td:first-child { 
    border-left: 1px solid var(--border-color); 
    border-radius: var(--radius-md) 0 0 var(--radius-md); 
}

.table-custom tbody td:last-child { 
    border-right: 1px solid var(--border-color); 
    border-radius: 0 var(--radius-md) var(--radius-md) 0; 
}

/* Login e Escolha de Perfil */
.login-card { 
    background: var(--glass); 
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-xl); 
    border: 1px solid var(--border-color); 
    box-shadow: var(--shadow-lg); 
    padding: 50px; 
    max-width: 500px; 
    width: 100%; 
    text-align: center;
}

.btn-profile { 
    border: 1px solid var(--border-color-light); 
    background: rgba(255, 255, 255, 0.03); 
    color: var(--text-main); 
    padding: 2rem 1.5rem; 
    border-radius: var(--radius-lg); 
    transition: var(--transition); 
    text-decoration: none; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.btn-profile:hover { 
    border-color: var(--accent); 
    background: var(--accent-glow); 
    transform: translateY(-5px); 
    color: var(--text-main); 
    box-shadow: var(--shadow-accent);
}

.btn-profile i { 
    font-size: 3rem; 
    margin-bottom: 15px; 
    color: var(--accent); 
    transition: var(--transition);
}

.btn-profile:hover i {
    transform: scale(1.1);
}

.btn-profile span {
    font-weight: 600;
    font-size: 1.1rem;
}

.btn-delete { color: var(--danger); transition: var(--transition); border: none; background: none; padding: 5px; }
.btn-delete:hover { color: #ff8888; transform: scale(1.1); }

/* Botões Padronizados */
.btn { 
    border-radius: var(--radius-md); 
    padding: 0.6rem 1.25rem; 
    font-weight: 600; 
    transition: var(--transition);
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-info {
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    border: none;
    color: var(--bg-main) !important;
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

.btn-outline-info {
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--accent);
}

.btn-outline-info:hover {
    background: var(--accent);
    color: var(--bg-main) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.2);
}

/* Scrollbar Customizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-input);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-input-focus);
}

/* Badges e Tags */
.badge {
    padding: 0.5em 0.8em;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.badge-me { 
    background-color: var(--accent); 
    color: var(--bg-main); 
    font-size: 0.7rem; 
    vertical-align: middle; 
    margin-left: 5px; 
    font-weight: bold; 
    border-radius: var(--radius-sm); 
}

/* Alertas Modernos */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-md);
}

.alert-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }
.alert-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.alert-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.alert-info { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }

/* Exercícios Layout */
.exercise-layout { display: flex; gap: 20px; align-items: center; }
.exercise-visual { width: 100px; height: 100px; background: #fff; border-radius: var(--radius-md); overflow: hidden; flex-shrink: 0; }
.exercise-visual img { width: 100%; height: 100%; object-fit: contain; }

/* Timer de Descanso */
#rest-timer { 
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); 
    background: var(--accent); color: var(--bg-main); 
    padding: 15px 25px; border-radius: 50px; font-weight: bold; 
    z-index: 2000; box-shadow: var(--shadow); 
    display: none; width: auto; max-width: 90%; text-align: center; 
}

/* Mapa e Busca */
#map-config { height: 300px; width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--border-color); margin-top: 15px; }
.search-results { position: absolute; z-index: 1001; width: 100%; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); max-height: 200px; overflow-y: auto; display: none; }
.search-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border-color-light); font-size: 0.85rem; }
.search-item:hover { background: var(--bg-input); color: var(--accent); }

/* Sidebar Link Styles */
.nav-link { 
    color: var(--text-muted); 
    padding: 0.8rem 1.25rem; 
    border-radius: var(--radius-md); 
    margin-bottom: 0.5rem; 
    transition: var(--transition);
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link i { 
    font-size: 1.25rem; 
    margin-right: 1rem;
    transition: var(--transition);
    opacity: 0.7;
}

.nav-link:hover { 
    background-color: rgba(255, 255, 255, 0.05); 
    color: var(--accent); 
    transform: translateX(8px);
}

.nav-link:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.nav-link.active { 
    background: linear-gradient(90deg, var(--accent), #0ea5e9); 
    color: var(--bg-main) !important; 
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
    font-weight: 600;
}

.nav-link.active i {
    color: var(--bg-main) !important;
    opacity: 1;
}

/* Responsividade */
@media (max-width: 992px) { 
    .sidebar { display: none !important; } 
    .main-content { margin-left: 0 !important; width: 100% !important; padding: 15px; padding-top: 10px; } 
    .card-aluno { flex-direction: row; text-align: left; padding: 12px 15px; }
    .exercise-layout { flex-direction: column; text-align: center; align-items: center; }
    .exercise-visual { width: 150px; height: 150px; margin-bottom: 15px; }
    .serie-dot { width: 40px; height: 40px; margin: 5px; font-size: 1rem; }
    .series-container { display: flex; flex-wrap: wrap; justify-content: center; }
    .card-aluno .d-flex:first-child { flex-direction: row; align-items: center; }
    .card-aluno .profile-img-list { margin-right: 12px !important; margin-bottom: 0; width: 45px; height: 45px; }
    .card-aluno h5 { font-size: 1rem; }
    .card-aluno .gap-2 { width: auto; justify-content: flex-end; }
    .card-aluno .btn { flex: none; padding: 6px 10px; }
}
