:root {
    --bg-color: #000000;
    --surface-color: #1c1c1e;
    --primary-color: #d4e339; /* Lime Green from mockup */
    --primary-hover: #c2d130;
    --accent-color: #d4e339;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #4b5563;
    --border-color: #2c2c2e;
    
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #000000;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 420px;
    height: 92vh;
    max-height: 900px;
    background-color: var(--bg-color);
    margin: auto;
    position: relative;
    box-shadow: 0 0 100px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    border-radius: 44px;
    border: 12px solid #1f2937;
    overflow: hidden;
}

main {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

main::-webkit-scrollbar {
    display: none;
}

@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
        height: 100vh;
        max-height: none;
        margin: 0;
        border-radius: 0;
        border: none;
    }
}

/* Status Bar & Notch */
.status-bar-mockup {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2.5rem 0.15rem; /* Ultra compact top bar */
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 100;
}

.notch {
    width: 160px;
    height: 34px;
    background: #000;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 101;
}

.status-icons {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

/* Main Header - Fixed height to avoid jumps */
.main-header {
    height: 75px; /* Further reduced from 90px */
    padding: 0 1.5rem 0.25rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

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

.mister-logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.m-letter {
    color: #d4e339;
    font-style: italic;
    font-size: 1.8rem;
    font-weight: 900;
}

/* Wizard Navigation (Refined) */
.wizard-progress {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem;
    background: rgba(28, 28, 30, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    margin-top: 0.5rem; /* Reduced from 1rem */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.wizard-progress::-webkit-scrollbar { display: none; }

.wizard-progress .step {
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    color: #888;
    font-weight: 700;
    font-size: 0.75rem;
    white-space: nowrap;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
}

.wizard-progress .step.active {
    background: #d4e339;
    color: #000;
    box-shadow: 0 4px 15px rgba(212, 227, 57, 0.4);
    transform: scale(1.05);
}

.profile-icon {
    color: #fff;
    opacity: 0.9;
}

/* Home Intro */
.home-intro {
    padding: 0 1.5rem;
    margin-top: 0.75rem; /* Added breath between header and body */
    margin-bottom: 1rem;
}

.home-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem; /* Slightly smaller */
    font-weight: 800;
    margin-bottom: 0.15rem;
    letter-spacing: -0.5px;
}

.home-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.4;
    max-width: 90%;
}

/* Example Card */
.example-card {
    position: relative;
    margin: 0 1.5rem;
    border-radius: 24px;
    overflow: hidden;
    height: 300px; /* Increased from 280px for a fuller image */
    border: 1px solid #333;
}

.example-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 0.5px;
}

.card-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.95));
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.footer-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #fff;
}

.footer-text p {
    font-size: 0.9rem;
    color: #9ca3af;
}

.info-icon {
    color: #fff;
    opacity: 0.8;
}

/* Pagination */
.pagination-dots {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin: 1rem 0;
}

.dot {
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
}

.dot.active {
    background: #d4e339;
    width: 12px;
    border-radius: 10px;
}

/* Home Actions */
.home-actions {
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
}

.btn-record {
    background: #d4e339;
    color: #000;
    border: none;
    padding: 1rem;
    border-radius: 18px;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload {
    background: #1c1c1e;
    color: #fff;
    border: none;
    padding: 1rem;
    border-radius: 18px;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-record:active { transform: scale(0.96); opacity: 0.9; }
.btn-upload:active { transform: scale(0.96); background: #2c2c2e; }

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px; /* Aligned with app-container */
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0 calc(1.5rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #1c1c1e;
    z-index: 10000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: #666;
    font-size: 0.7rem;
    font-weight: 600;
}

.nav-item.active {
    color: #d4e339;
}

.nav-item svg {
    width: 22px;
    height: 22px;
}

/* Helper Classes */
.hidden { display: none !important; }

/* Home Indicator */
.home-indicator-mockup {
    width: 140px;
    height: 5px;
    background: #333;
    border-radius: 10px;
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
}

@media (max-width: 480px) {
    .home-indicator-mockup { display: none; }
    .status-bar-mockup, .notch { display: none; }
}

/* Transitions */
.step-container {
    animation: fadeIn 0.4s ease-out;
}

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

/* Phases Grid */
.phases-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 1.5rem;
    margin-bottom: 1.5rem;
}

.phase-card {
    background: #1c1c1e;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.phase-img-container {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.phase-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.phase-info {
    flex: 1;
}

.phase-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: #fff;
}

.phase-metric {
    color: #d4e339;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Insights Panel */
.insights-panel {
    background: #1c1c1e;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 1.5rem;
    margin: 0 1.5rem 1.5rem;
    color: #fff;
}

.insights-panel h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

#insights-list li {
    background: #2c2c2e;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    border-left: 4px solid #d4e339;
}

#insights-list li.positive { border-left-color: #d4e339; }
#insights-list li.warning { border-left-color: #f59e0b; }
#insights-list li.danger { border-left-color: #ef4444; }

/* Chart Container */
.chart-container {
    background: #1c1c1e;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 1rem;
    margin: 0 1.5rem 1rem;
    height: 250px; /* Reduced from 300px for mobile */
}

/* --- ESTILOS PARA OS OUTROS PASSOS (Para não quebrar a UI escura) --- */
.video-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

#output_canvas, #video, #video-combined, #trim-video {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    margin: 0 auto;
}

#output_canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.player-container {
    position: relative;
    background: #0a0a0a;
    border-radius: 32px; 
    overflow: hidden;
    width: 100%;
    height: 55vh; 
    max-height: 500px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.video-comparison-loader {
    background: rgba(0,0,0,0.8) !important;
    backdrop-filter: blur(8px);
}

.video-comparison-loader p {
    color: var(--primary-color) !important;
    font-weight: 800 !important;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    padding: 0 1.5rem;
    text-align: center;
    letter-spacing: -0.5px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 0 2rem;
    margin-bottom: 2rem;
    text-align: center;
    line-height: 1.5;
}

/* Ensure step containers have enough bottom space for buttons */
.step-container {
    padding-bottom: 100px;
}

/* Buttons */
.action-btn {
    background: #d4e339;
    color: #000;
    border: none;
    padding: 1.1rem 2.5rem;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 90%;
    max-width: 320px;
    box-shadow: 0 10px 20px rgba(212, 227, 57, 0.2);
}

.action-btn:hover {
    background: #e0f04a;
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(212, 227, 57, 0.3);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn:disabled {
    background: #2c2c2e;
    color: #666;
    box-shadow: none;
    cursor: not-allowed;
}

.secondary-btn {
    background: transparent;
    color: #9ca3af;
    border: 1px solid #333;
    padding: 1.1rem 2rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

/* Trim Slider UI */
.trim-slider-container {
    width: 90%;
    margin: 2rem auto;
}

.trim-track {
    width: 100%;
    height: 12px;
    background: #333;
    border-radius: 6px;
    position: relative;
}

.trim-highlight {
    position: absolute;
    height: 100%;
    background: #d4e339;
    border-radius: 6px;
}

.trim-thumb {
    width: 24px;
    height: 24px;
    background: #fff;
    border: 4px solid #d4e339;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    z-index: 2;
}

.trim-times {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    color: #9ca3af;
    font-weight: 600;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(212, 227, 57, 0.2);
    border-top-color: #d4e339;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(212, 227, 57, 0.2);
    border-top-color: #d4e339;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.step-container {
    padding-bottom: 100px;
    position: relative;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    text-align: center;
}

.loading-overlay-phases {
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    text-align: center;
    padding: 2rem;
    border: 1px solid #333;
    margin-bottom: 2rem;
}

/* Comparison Step Styles */
.athlete-selector {
    display: flex;
    gap: 1rem;
    padding: 0 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.athlete-card {
    flex: 1;
    background: #1c1c1e;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.athlete-card.active {
    border-color: #d4e339;
    background: rgba(212, 227, 57, 0.05);
}

.athlete-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #333;
}

.athlete-info {
    display: flex;
    flex-direction: column;
}

.athlete-name {
    font-weight: 700;
    color: #fff;
}

.athlete-desc {
    font-size: 0.75rem;
    color: #9ca3af;
}

.comparison-layout {
    padding: 0 1.5rem;
}

.video-comparison-container {
    width: 100%;
    margin-bottom: 1.5rem;
}

.player-wrapper.combined {
    position: relative;
    background: #1c1c1e;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #333;
}

.combined-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #2c2c2e;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #9ca3af;
}

.skeleton-switch-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

.ai-switch input { opacity: 0; width: 0; height: 0; }

.ai-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 20px;
}

.ai-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .ai-slider { background-color: #d4e339; }
input:checked + .ai-slider:before { transform: translateX(14px); }

.comparison-info-hint {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.4;
}

.similarity-badge {
    background: #1c1c1e;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.similarity-val {
    font-size: 2.5rem;
    font-weight: 800;
    color: #d4e339;
    font-family: 'Outfit', sans-serif;
}

.similarity-label {
    font-size: 0.8rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

.comparison-table-container {
    background: #1c1c1e;
    border: 1px solid #333;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th {
    background: #2c2c2e;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
}

.comparison-table td {
    padding: 1rem;
    border-top: 1px solid #333;
    font-size: 0.9rem;
}

.comparison-charts-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 2rem;
}

/* Floating Scroll Button */
.scroll-bottom-btn {
    position: absolute;
    right: 1.5rem;
    bottom: 6.5rem; /* Slightly higher to clear nav */
    width: 46px;
    height: 46px;
    background: rgba(44, 44, 46, 0.7); /* Semi-transparent gray */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.scroll-bottom-btn:active { transform: scale(0.9); }

.scroll-bottom-btn.vibrate {
    animation: pulseVibrate 0.6s ease-in-out 1;
}

@keyframes pulseVibrate {
    0% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1); }
}

/* History styles */
.history-list { padding: 0 1.5rem; }
.history-card {
    background: #1c1c1e;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.history-thumb {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #333 url('https://images.unsplash.com/photo-1476480862126-209bfaa8edc8?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&q=80') center/cover;
    position: relative;
}
.score-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary-color);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 6px;
}
.history-info { flex: 1; }
.history-date { font-size: 0.75rem; color: #666; margin-bottom: 2px; }
.history-title { font-weight: 700; font-size: 0.95rem; }
.history-meta { font-size: 0.75rem; color: #9ca3af; }

/* Evolution styles */
.evolution-stats { display: flex; gap: 1rem; padding: 0 1.5rem; margin-bottom: 1rem; }
.evo-stat-card {
    flex: 1;
    background: #1c1c1e;
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
}
.evo-label { display: block; font-size: 0.75rem; color: #9ca3af; margin-bottom: 4px; }
.evo-val { font-size: 1.25rem; font-weight: 800; color: var(--primary-color); }
.badge-row { display: flex; gap: 0.5rem; padding: 0 1.5rem; margin-top: 1.5rem; }
.evo-badge {
    background: #1c1c1e;
    color: #444;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}
.evo-badge.active { background: #333; color: #fff; }

/* Tips styles */
.tips-grid { display: flex; flex-direction: column; gap: 1rem; padding: 0 1.5rem; }
.tip-card {
    background: #1c1c1e;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    height: 100px;
}
.tip-img { width: 100px; height: 100%; background-size: cover; background-position: center; }
.tip-content { padding: 1rem; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.tip-content h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.tip-content p { font-size: 0.75rem; color: #9ca3af; line-height: 1.3; }

/* Profile styles */
.profile-header { text-align: center; padding: 2rem 0; }
.profile-avatar-large {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #333 url('https://images.unsplash.com/photo-1500648767791-00dcc994a43e?ixlib=rb-1.2.1&auto=format&fit=crop&w=200&q=80') center/cover;
    margin: 0 auto 1rem;
    border: 3px solid var(--primary-color);
}
.profile-header h3 { font-size: 1.5rem; font-weight: 800; }
.profile-header p { color: #9ca3af; font-size: 0.9rem; }
.profile-stats-grid { display: flex; justify-content: space-around; padding: 1.5rem; background: #1c1c1e; margin: 0 1.5rem; border-radius: 24px; }
.p-stat { text-align: center; }
.p-stat-val { font-size: 1.25rem; font-weight: 800; color: #fff; }
.p-stat-label { font-size: 0.7rem; color: #666; text-transform: uppercase; margin-top: 2px; }
.profile-menu { padding: 2rem 1.5rem; }
.p-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
    border-bottom: 1px solid #1c1c1e;
    font-weight: 600;
}

