﻿/* --- CSS VARIABLES & DESIGN SYSTEM --- */
:root {
    --primary-color: #8DA9A0;
    --primary-light: #B8D0C6;
    --primary-dark: #5F7A71;
    --secondary-color: #E2B8A6;
    --accent-color: #D6A49B;
    --text-main: #3E4B47;
    --text-muted: #798C87;
    --text-light: #F9FAF9;
    --bg-color: #F8F9F8;
    --surface-color: rgba(255, 255, 255, 0.85);
    --surface-hover: rgba(255, 255, 255, 1);
    --success: #6CB08E;
    --warning: #EDB36F;
    --danger: #E47C7C;
    --info: #79A3D0;
    --font-family: 'Outfit', sans-serif;
    --shadow-sm: 0 4px 15px rgba(0,0,0,0.03);
    --shadow-md: 0 8px 25px rgba(62, 75, 71, 0.08);
    --shadow-glass: inset 0 0 0 1px rgba(255,255,255,0.4), 0 8px 30px rgba(0,0,0,0.05);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 30px;
    --radius-full: 9999px;
    --transition: cubic-bezier(0.2, 0.8, 0.2, 1);
    --primary-gradient: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    --shadow-hover: 0 12px 35px rgba(62, 75, 71, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
*:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 2px; transition: outline-color 0.2s; }
body { font-family: var(--font-family); color: var(--text-main); background-color: var(--bg-color); line-height: 1.5; overscroll-behavior-y: none; overflow: hidden; height: 100vh; height: 100dvh; width: 100vw; }
.app-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; background-image: url('../assets/images/cintura_fina_bg_curves.png'); background-size: cover; background-position: center; background-repeat: no-repeat; opacity: 1; }
.app-container { width: 100%; height: 100%; max-width: 500px; margin: 0 auto; background: transparent; position: relative; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-md); }
@media (min-width: 501px) and (max-width: 767px) { 
    body { display: flex; align-items: center; justify-content: center; background-color: #E2E8E4; } 
    .app-bg { filter: blur(20px); opacity: 0.5; } 
    .app-container { height: 90vh; max-height: 900px; border-radius: var(--radius-lg); background: var(--bg-color); } 
}



.view-container { flex: 1; overflow-y: auto; padding: 24px 20px 100px 20px; animation: fadeInView 0.5s var(--transition) forwards; -ms-overflow-style: none; scrollbar-width: none; }
/* Custom scrollbar for better desktop experience */
@media (max-width: 767px) {
    .view-container::-webkit-scrollbar { display: none; }
}
@media (min-width: 768px) {
    .view-container::-webkit-scrollbar { width: 8px; }
    .view-container::-webkit-scrollbar-track { background: rgba(0,0,0,0.02); border-radius: 10px; }
    .view-container::-webkit-scrollbar-thumb { background: rgba(141, 169, 160, 0.3); border-radius: 10px; transition: background 0.2s; }
    .view-container::-webkit-scrollbar-thumb:hover { background: rgba(141, 169, 160, 0.6); }
}
@keyframes fadeInView { 0% { opacity: 0; } 100% { opacity: 1; } }

h1 { font-size: 28px; font-weight: 600; margin-bottom: 8px; color: var(--text-main); }
h2 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
h3 { font-size: 16px; font-weight: 500; }
p { font-size: 14px; color: var(--text-muted); }

.card { background: var(--surface-color); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-glass); transition: transform 0.3s var(--transition), background 0.3s; }

.card:hover { background: var(--surface-hover); transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.input-group { margin-bottom: 16px; display: flex; flex-direction: column; }
.input-group label { font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-muted); }
input, select { width: 100%; padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid rgba(141, 169, 160, 0.2); background: rgba(255, 255, 255, 0.7); font-family: inherit; font-size: 15px; color: var(--text-main); transition: all 0.3s ease; outline: none; }
input:focus, select:focus { border-color: var(--primary-color); background: #fff; box-shadow: 0 0 0 3px rgba(141, 169, 160, 0.15); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 16px; border-radius: var(--radius-md); font-weight: 600; font-size: 15px; font-family: inherit; border: none; cursor: pointer; transition: all 0.3s var(--transition); }

.btn-primary { background: var(--primary-gradient); color: white; box-shadow: 0 6px 15px rgba(141, 169, 160, 0.4); text-shadow: 0 1px 2px rgba(0,0,0,0.1); border: 1px solid rgba(255,255,255,0.1); }
.btn-primary:active, .btn-secondary:active, .btn-outline:active { transform: scale(0.96); box-shadow: 0 2px 8px rgba(141, 169, 160, 0.2); }
.btn-danger { background: rgba(228, 124, 124, 0.15); color: var(--danger); border: 1px solid rgba(228, 124, 124, 0.3); box-shadow: none; }
.btn-danger:hover { background: rgba(228, 124, 124, 0.25); }
.btn-secondary { background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%); color: white; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 6px 15px rgba(226, 184, 166, 0.3); }


.btn-outline { background: transparent; border: 1px solid var(--primary-color); color: var(--primary-color); }
.btn-text { background: transparent; color: var(--primary-color); padding: 12px; }

.badge { padding: 4px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; display: inline-block; }
.badge.success { background: rgba(108, 176, 142, 0.15); color: var(--success); }
.badge.warning { background: rgba(237, 179, 111, 0.15); color: var(--warning); }
.badge.danger { background: rgba(228, 124, 124, 0.15); color: var(--danger); }
.badge.info { background: rgba(121, 163, 208, 0.15); color: var(--info); }

.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; height: 70px; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); display: flex; justify-content: space-around; align-items: center; border-top: 1px solid rgba(0,0,0,0.05); padding-bottom: env(safe-area-inset-bottom); z-index: 100; transform: translateY(100%); transition: transform 0.4s var(--transition); }
.bottom-nav.visible { transform: translateY(0); }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); text-decoration: none; font-size: 11px; font-weight: 500; flex: 1; height: 100%; transition: color 0.3s; cursor: pointer; }
.nav-item.hidden-role { display: none !important; }
.nav-item ion-icon { font-size: 24px; margin-bottom: 4px; transition: transform 0.3s var(--transition); }
.nav-item.active { color: var(--primary-dark); font-weight: 700; }
.nav-item.active ion-icon { transform: translateY(-3px) scale(1.1); color: var(--primary-dark); }

.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.user-avatar { width: 44px; height: 44px; border-radius: var(--radius-full); background: var(--secondary-color); display: flex; align-items: center; justify-content: center; color: white; font-weight: 600; font-size: 18px; }

.toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 400px; z-index: 999999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { background: white; color: var(--text-main); padding: 16px 20px; border-radius: var(--radius-md); box-shadow: 0 10px 30px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; animation: toastEnter 0.4s var(--transition) forwards; }
.toast ion-icon { font-size: 22px; }
.toast.success ion-icon { color: var(--success); }
.toast.error ion-icon { color: var(--danger); }
.toast.info ion-icon { color: var(--info); }
.toast.fade-out { animation: toastExit 0.4s var(--transition) forwards; }
@keyframes toastEnter { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastExit { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }

.text-center { text-align: center; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mb-0 { margin-bottom: 0px !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; } .flex-column { display: flex; flex-direction: column; } .align-center { align-items: center; } .justify-between { justify-content: space-between; } .hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (min-width: 768px) {
    body { display: flex; flex-direction: row; padding: 40px; gap: 30px; background-color: #E2E8E4; justify-content: center; align-items: stretch; height: 100vh; height: 100dvh; }
    .app-bg { filter: blur(20px); opacity: 0.5; }
    
    .bottom-nav { position: static; width: 280px; height: 100%; max-height: 900px; transform: none !important; flex-direction: column; justify-content: flex-start; align-items: flex-start; padding: 40px 24px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); border-top: none; }
    .bottom-nav { order: -1; position: static; width: 280px; height: 100%; max-height: 900px; transform: none !important; flex-direction: column; justify-content: flex-start; align-items: flex-start; padding: 40px 24px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); border-top: none; }
    .bottom-nav.visible { transform: none !important; }
    .nav-item { flex-direction: row; justify-content: flex-start; font-size: 15px; width: 100%; padding: 18px 24px; border-radius: 14px; margin-bottom: 10px; flex: none; height: auto; transition: background 0.2s, color 0.2s; }
    .nav-item:hover { background: rgba(141, 169, 160, 0.08); }
    .nav-item.active { background: rgba(141, 169, 160, 0.15); }
    .nav-item ion-icon { font-size: 24px; margin-bottom: 0; margin-right: 18px; }
    #logout-btn { margin-top: auto; border-top: 1px solid rgba(141, 169, 160, 0.2); border-radius: 0; padding-top: 24px; }
    
    .app-container { max-width: 1000px; height: 100%; max-height: 900px; flex: 1; border-radius: var(--radius-lg); margin: 0; box-shadow: var(--shadow-md); }
    .view-container { padding: 40px 50px; }
    
    .grid-2 { gap: 24px; }
}

/* Modal Bounce Animations */
@keyframes bounceInModal {
    0% { opacity: 0; transform: translateY(-30px) scale(0.95); }
    70% { opacity: 1; transform: translateY(5px) scale(1.02); }
    100% { opacity: 1; transform: none; }
}

@keyframes bounceOutModal {
    0% { opacity: 1; transform: none; }
    100% { opacity: 0; transform: translateY(-30px) scale(0.95); }
}

.animate-modal-pop {
    animation: bounceInModal 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.25) forwards;
}

.animate-modal-pop-out {
    animation: bounceOutModal 0.25s ease-in forwards;
}

/* UI Turmas Pills */
.turma-pill {
    padding: 8px 14px; margin: 4px; border: 1px solid rgba(141, 169, 160, 0.4);
    border-radius: 20px; font-size: 13px; font-weight: 500; color: var(--text-main);
    cursor: pointer; background: white; transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); user-select: none;
    display: inline-block;
}
.turma-pill:hover { background: rgba(141, 169, 160, 0.08); transform: translateY(-2px); }
.turma-pill.active {
    background: var(--primary-gradient); color: white;
    border-color: transparent; box-shadow: 0 4px 10px rgba(141, 169, 160, 0.4);
}

/* Special layout for schedule view to allow sticky headers inside table */
.view-container.schedule-view-mode {
    display: flex;
    flex-direction: column;
    overflow-y: hidden !important;
    padding-bottom: 0 !important;
}
@media (max-width: 767px) {
    .view-container.schedule-view-mode {
        padding-bottom: 70px !important; /* reserve space for bottom nav */
    }
}
