/**
 * Calculadora de CAC - Styles
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 */

/* ===== CSS Variables ===== */
:root {
    --primary: #833AB4;
    --secondary: #FD1D1D;
    --accent-1: #F77737;
    --accent-2: #FCAF45;
    --accent-3: #FFDC80;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-light: #ffffff;
    
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    --border-radius: 8px;
    --transition: all 0.3s ease;
    
    --nav-height: 70px;
    --header-height: 170px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding-bottom: var(--nav-height);
    padding-top: var(--header-height);
    min-height: 100vh;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    margin-bottom: var(--spacing-md);
}

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    display: none;
    padding: var(--spacing-lg) 0;
    min-height: calc(100vh - var(--header-height) - var(--nav-height));
}

.section.active {
    display: block;
}

/* ===== Header ===== */
.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-light);
    padding: var(--spacing-lg) 0;
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
    min-height: var(--header-height);
}

.app-header .container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.app-header h1 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.app-header .subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.app-header .title-group {
    display: flex;
    flex-direction: column;
}

.app-header .logo {
    height: 120px;
    width: auto;
    display: block;
}

@media (max-width: 768px) {
    .app-header .logo {
        height: 100px;
    }
}
.black-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 30px;
background-color: #000000;
z-index: 1001;
}
/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h2, .card h3 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--primary);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
}

input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(131, 58, 180, 0.1);
}

input:invalid:not(:placeholder-shown) {
    border-color: var(--secondary);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-light);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-danger {
    background: var(--secondary);
    color: var(--text-light);
}

.btn-danger:hover {
    background: #e01a1a;
}

.btn-small {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    min-height: 36px;
}

/* ===== LTV Card ===== */
.ltv-card {
    background: linear-gradient(135deg, rgba(131, 58, 180, 0.1) 0%, rgba(253, 29, 29, 0.1) 100%);
    border: 2px solid var(--primary);
}

.ltv-display {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    text-align: center;
}

.ltv-display strong {
    color: var(--primary);
    font-size: 1.5rem;
}

/* ===== Channels List ===== */
.channels-list {
    display: grid;
    gap: var(--spacing-md);
}

.channel-item {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.channel-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.channel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.channel-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

.channel-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.metric {
    text-align: center;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.channel-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

/* ===== Summary Section ===== */
.summary-section {
    margin-bottom: var(--spacing-xl);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.summary-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-light);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.summary-card i {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.9;
}

.summary-card h3 {
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.9;
    color: var(--text-light);
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

/* ===== Chart ===== */
.chart-card {
    position: relative;
    min-height: 400px;
}

#cac-chart {
    max-height: 400px;
}

/* ===== LTV:CAC Analysis ===== */
.ltv-cac-list {
    display: grid;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.ltv-cac-item {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.ltv-cac-item.excellent {
    border-left-color: #28a745;
}

.ltv-cac-item.warning {
    border-left-color: #ffc107;
}

.ltv-cac-item.danger {
    border-left-color: #dc3545;
}

.ltv-cac-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.traffic-light {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.traffic-light.green {
    background: #28a745;
    color: white;
}

.traffic-light.yellow {
    background: #ffc107;
    color: #333;
}

.traffic-light.red {
    background: #dc3545;
    color: white;
}

.ltv-cac-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-md);
}

.legend-box {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-top: var(--spacing-lg);
}

.legend-box h4 {
    margin-bottom: var(--spacing-md);
}

.legend-box ul {
    list-style: none;
}

.legend-box li {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
}

.indicator.green { background: #28a745; }
.indicator.yellow { background: #ffc107; }
.indicator.red { background: #dc3545; }

/* ===== FAQ ===== */
.faq-container {
    display: grid;
    gap: var(--spacing-md);
}

.faq-item {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.faq-question {
    width: 100%;
    padding: var(--spacing-lg);
    background: var(--bg-card);
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    color: var(--text-primary);
    font-family: inherit;
    min-height: 44px;
}

.faq-question:hover {
    background: var(--bg-secondary);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary);
    transition: var(--transition);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 var(--spacing-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer:not([hidden]) {
    padding: var(--spacing-lg);
    max-height: 500px;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    display: flex;
    justify-content: space-around;
    padding: var(--spacing-sm) 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    height: var(--nav-height);
    margin-bottom: 80px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    flex: 1;
    min-height: 44px;
}

.nav-item i {
    font-size: 1.5rem;
}

.nav-item span {
    font-size: 0.75rem;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:hover {
    color: var(--primary);
    background: rgba(131, 58, 180, 0.05);
}

/* ===== Footer ===== */
.app-footer {
    background: var(--bg-card);
    padding: var(--spacing-xl) 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: var(--spacing-xl);
    margin-bottom: 60px;
}

.app-footer p {
    margin-bottom: var(--spacing-sm);
}

.b20-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.b20-link:hover {
    text-decoration: underline;
    transform: scale(1.05);
    display: inline-block;
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    top: calc(var(--header-height) + var(--spacing-md));
    right: var(--spacing-md);
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
    border-left: 4px solid var(--primary);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: #28a745;
}

.toast.error {
    border-left-color: #dc3545;
}

.toast.warning {
    border-left-color: #ffc107;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state .hint {
    font-size: 0.875rem;
    margin-top: var(--spacing-sm);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    :root {
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
        --header-height: 150px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .channel-metrics {
        grid-template-columns: 1fr;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .ltv-cac-metrics {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--spacing-xl);
    }
    
    .section {
        padding: var(--spacing-xl) 0;
    }
}

/* ===== Accessibility ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.channel-item,
.summary-card,
.ltv-cac-item {
    animation: fadeIn 0.3s ease;
}

/* ===== Print Styles ===== */
@media print {
    .bottom-nav,
    .app-header,
    .app-footer,
    .btn {
        display: none;
    }
    
    .section {
        display: block !important;
    }
}
