/* ==========================================================================
   Quilos Off - Style Sheet
   ========================================================================== */

/* Font & CSS Variables */
:root {
    /* Color Palette - Light Theme (Default) */
    --bg-primary: #e4ebf2; /* Fundo um pouco mais escuro para contraste */
    --bg-card: rgba(255, 255, 255, 0.85); /* Vidro mais opaco para destaque */
    --border-color: rgba(255, 255, 255, 0.65);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --primary-color: #8b5cf6; /* Lavender */
    --primary-gradient: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    --accent-pink: #ec4899;
    --accent-blue: #06b6d4;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;

    --card-shadow: 0 8px 32px 0 rgba(142, 151, 168, 0.08);
    --border-radius: 20px;
    --border-radius-sm: 12px;
    
    --card-border: rgba(139, 92, 246, 0.16); /* Contorno discreto lavanda */
    --transition-speed: 0.3s;
}



/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* Background Blur Decorative Blobs */
.blob {
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    filter: blur(100px);
    opacity: 0.15;
    pointer-events: none;
    transition: transform 10s ease-in-out;
}
.blob-1 {
    width: 350px;
    height: 350px;
    background: #06b6d4; /* cyan */
    top: -50px;
    left: -50px;
}
.blob-2 {
    width: 400px;
    height: 400px;
    background: #ec4899; /* pink */
    bottom: -100px;
    right: -100px;
}
.blob-3 {
    width: 300px;
    height: 300px;
    background: #a78bfa; /* lavender */
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.1;
}



/* Glassmorphism utility */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

/* Button Styles */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
    transition: all var(--transition-speed) ease;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-speed) ease;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}
.btn-icon.danger {
    color: var(--accent-red);
}
.btn-icon.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-text-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color var(--transition-speed) ease;
}
.btn-text-icon:hover {
    color: var(--primary-color);
}

/* Floating Action Button (FAB) */
.fab-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    z-index: 10;
    transition: all var(--transition-speed) cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.fab-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.7);
}

/* Badges */
.badge {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* Global inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}
.input-group input {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: all var(--transition-speed) ease;
}
.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
    background: rgba(255, 255, 255, 0.1);
}

/* Screen Flash Overlay */
.flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
}
.flash-overlay.active {
    animation: redFlash 1.2s forwards;
}

@keyframes redFlash {
    0% { opacity: 0; }
    20% { opacity: 0.8; background-color: rgba(239, 68, 68, 0.35); }
    40% { opacity: 0; }
    60% { opacity: 0.8; background-color: rgba(239, 68, 68, 0.35); }
    100% { opacity: 0; }
}

/* ==========================================================================
   SECTION: LOGIN SCREEN
   ========================================================================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
    border-radius: var(--border-radius);
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.logo-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: var(--primary-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}
.logo-icon {
    font-size: 36px;
    color: white;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.login-header p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.5;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.error-msg {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ==========================================================================
   SECTION: APP CONTAINER & HEADER
   ========================================================================== */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 20px 100px;
    animation: fadeIn 0.5s ease-out;
}

.app-header {
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}
.app-logo {
    font-size: 24px;
    color: var(--primary-color);
}
.logo-area h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Stats Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.stat-card {
    border-radius: var(--border-radius-sm);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.stat-icon-wrapper.prize {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}
.stat-icon-wrapper.days {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-blue);
}
.stat-icon-wrapper.leader {
    background: rgba(236, 72, 153, 0.15);
    color: var(--accent-pink);
}

.stat-info {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-info h3 {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

/* Tab Switcher */
.tabs-container {
    position: relative;
    border-radius: 30px;
    padding: 6px;
    display: flex;
    z-index: 1;
}

.tabs-slider {
    position: absolute;
    top: 6px;
    left: 6px;
    bottom: 6px;
    width: calc(50% - 6px);
    background: var(--primary-gradient);
    border-radius: 24px;
    z-index: -1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 24px;
    transition: color var(--transition-speed) ease;
}
.tab-btn.active {
    color: white;
}

/* ==========================================================================
   TAB 1: PARTICIPANTS LAYOUT
   ========================================================================== */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}
.tab-content.active {
    display: block;
}

/* Podium Section */
.podium-wrapper {
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 24px;
}
.podium-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 15px;
}
.podium-row {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding-top: 15px;
}
.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 30%;
    text-align: center;
}
.podium-avatar-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    margin-bottom: 10px;
}
.podium-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
}
.podium-num {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: white;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.place-1 .podium-avatar {
    width: 80px;
    height: 80px;
    border-color: var(--accent-orange);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}
.place-1 .podium-num { background: var(--accent-orange); }
.place-2 .podium-avatar { border-color: #cbd5e1; }
.place-2 .podium-num { background: #94a3b8; }
.place-3 .podium-avatar { border-color: #b45309; }
.place-3 .podium-num { background: #b45309; }

.podium-crown {
    position: absolute;
    top: -18px;
    font-size: 20px;
    color: var(--accent-orange);
    transform: rotate(-10deg);
}

.podium-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.podium-stat {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-green);
}

.participants-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}
.participants-header h3 {
    font-size: 18px;
    font-weight: 700;
}

/* Grid of Cards */
.participants-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Participant Card */
.participant-card {
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    cursor: pointer;
    border: 1.5px solid var(--card-border);
    transition: all var(--transition-speed) ease;
}
.participant-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.p-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    background-color: var(--border-color);
}

.p-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.p-name {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.p-subinfo {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Badge for Kilos Lost */
.loss-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.05);
}
.loss-badge.gain {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.2);
}

.card-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--border-radius-sm);
    text-align: center;
}
.stat-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-box-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}
.stat-box-value {
    font-size: 14px;
    font-weight: 700;
}

/* ==========================================================================
   OBESITY GAUGE BAR (CUSTOM SCALE)
   ========================================================================== */
.gauge-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 5px;
}

.gauge-labels-top {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 2px;
}

/* The actual bar container */
.gauge-bar-container {
    position: relative;
    height: 12px;
    border-radius: 6px;
    overflow: visible; /* to let the smiley overlay exceed */
    display: flex;
}

.gauge-segment {
    height: 100%;
}
/* Four segments like Image 2 */
.gauge-segment.baixo {
    width: 25%;
    background-color: var(--accent-blue);
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}
.gauge-segment.saudavel {
    width: 25%;
    background-color: var(--accent-green);
}
.gauge-segment.alto {
    width: 25%;
    background-color: var(--accent-orange);
}
.gauge-segment.obeso {
    width: 25%;
    background-color: var(--accent-red);
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* Marker / Pin point */
.gauge-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: left 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}
.gauge-marker i {
    font-size: 12px;
    font-weight: bold;
}

.gauge-labels-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 700;
    padding: 0 4px;
}
.gauge-labels-bottom span {
    width: 25%;
    text-align: center;
}
.gauge-labels-bottom span:first-child { text-align: left; }
.gauge-labels-bottom span:last-child { text-align: right; }

/* ==========================================================================
   TAB 2: EVOLUTION CHART & LOGS
   ========================================================================== */
.chart-card {
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
}
.chart-header h3, .history-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}
.chart-header p, .history-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}

.history-card {
    border-radius: var(--border-radius);
    padding: 24px;
}

.history-table-wrapper {
    width: 100%;
    overflow-x: auto;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}
.history-table th {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
}
.history-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.history-table tr:last-child td {
    border-bottom: none;
}
.history-p-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}
.history-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.history-diff-badge {
    font-weight: 700;
    font-size: 13px;
}
.history-diff-badge.gain {
    color: var(--accent-red);
}
.history-diff-badge.loss {
    color: var(--accent-green);
}
.history-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
    transition: all var(--transition-speed) ease;
}
.history-delete-btn:hover {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   MODALS LAYOUT
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity var(--transition-speed) ease;
    padding: 20px;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 480px;
    padding: 28px;
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.9);
}

.modal-content.mini-modal {
    max-width: 380px;
}

/* Bottom Sheet Modal for Mobile Actions */
.modal-content.bottom-sheet {
    max-width: 420px;
    animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.hidden .modal-content.bottom-sheet {
    transform: translateY(100%);
}

.modal-drag-indicator {
    width: 40px;
    height: 5px;
    background: var(--text-muted);
    border-radius: 3px;
    margin: -10px auto 15px;
    opacity: 0.5;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.modal-header h3 {
    font-size: 20px;
    font-weight: 800;
}
.btn-close-modal {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    transition: color var(--transition-speed) ease;
}
.btn-close-modal:hover {
    color: var(--text-primary);
}

/* Grid of Actions buttons inside Bottom Sheet */
.actions-buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-card-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-speed) ease;
}
.action-card-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}
.action-card-btn:active {
    transform: translateY(0);
}

.action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.action-icon.weight {
    background: rgba(139, 92, 246, 0.15);
    color: var(--primary-color);
}
.action-icon.edit {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-blue);
}
.action-icon.delete {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}
.action-card-btn.danger:hover {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.action-text h4 {
    font-size: 15px;
    font-weight: 700;
}
.action-text p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Forms design */
#participant-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}
.form-group input {
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all var(--transition-speed) ease;
}
.form-group input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 15px;
}

/* Avatar File Upload Styling */
.avatar-upload-group {
    align-items: center;
}
.avatar-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}
.avatar-preview-container {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-color);
    cursor: pointer;
}
.avatar-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.upload-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 11px;
    text-align: center;
    padding: 4px 0;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}
.avatar-preview-container:hover .upload-badge {
    opacity: 1;
}

.avatar-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.weight-avatar-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.02);
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
}
.weight-p-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
#weight-p-name {
    font-weight: 700;
    font-size: 15px;
}

/* Configurations CSS */
.config-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.config-section:last-child {
    border-bottom: none;
}
.config-section h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.config-section p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}
.input-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}
.backup-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.config-section ul {
    list-style: none;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.config-section ul strong {
    color: var(--text-primary);
}

.server-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ==========================================================================
   APP FOOTER
   ========================================================================== */
.app-footer {
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}
.footer-quote {
    font-size: 14px;
    font-style: italic;
    color: var(--text-secondary);
    max-width: 80%;
    line-height: 1.5;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUpModal {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   RESPONSIVENESS (MOBILE FRIENDLY)
   ========================================================================== */
@media (max-width: 600px) {
    .app-container {
        padding: 10px 10px 80px;
    }
    
    .app-header {
        padding: 16px;
        gap: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .podium-avatar {
        width: 50px;
        height: 50px;
    }
    .place-1 .podium-avatar {
        width: 65px;
        height: 65px;
    }
    .podium-crown {
        top: -15px;
        font-size: 16px;
    }
    
    .p-avatar {
        width: 50px;
        height: 50px;
    }
    .p-name {
        font-size: 16px;
    }
    .loss-badge {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .card-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .gauge-marker {
        width: 20px;
        height: 20px;
    }
    .gauge-marker i {
        font-size: 10px;
    }
    .gauge-labels-bottom span {
        font-size: 10px;
    }
    
    .modal-content {
        padding: 20px;
        border-radius: 24px 24px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        max-height: 85vh;
    }
    
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    
    .modal-content:not(.bottom-sheet) {
        animation: slideUpModal 0.3s ease-out;
    }
    
    .fab-btn {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
}
