/**
 * Estilos do Frontend - Myragen Afiliados
 */

/* Reset e Base */
.myragen-affiliate-dashboard,
.myragen-register-form,
.myragen-login-form,
.myragen-message {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Mensagens */
.myragen-message {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    max-width: 500px;
    margin: 40px auto;
}

.myragen-message h3 {
    margin: 0 0 15px;
    font-size: 24px;
    color: #1a1a1a;
}

.myragen-message p {
    margin: 0 0 25px;
    color: #666;
}

.myragen-message.warning {
    border-left: 4px solid #f0ad4e;
}

.myragen-message.error {
    border-left: 4px solid #dc3545;
}

/* Botões */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: #fff;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.btn-icon:hover {
    opacity: 1;
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}

.welcome-section h2 {
    margin: 0;
    font-size: 28px;
    color: #1a1a1a;
}

.affiliate-code {
    margin: 5px 0 0;
    color: #666;
}

.affiliate-code strong {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quick-actions {
    display: flex;
    gap: 10px;
}

/* Navegação */
.dashboard-nav {
    display: flex;
    gap: 5px;
    background: #f8f9fa;
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-item {
    padding: 12px 24px;
    border-radius: 8px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-item:hover {
    color: #667eea;
    background: #fff;
}

.nav-item.active {
    background: #fff;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Tabs */
.dashboard-tab {
    display: none;
}

.dashboard-tab.active {
    display: block;
}

/* Link de Afiliado */
.affiliate-link-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    color: #fff;
}

.affiliate-link-box h3 {
    margin: 0 0 15px;
    font-size: 18px;
    opacity: 0.9;
}

.link-copy-wrapper {
    display: flex;
    gap: 10px;
}

.link-copy-wrapper input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255,255,255,0.95);
    color: #333;
}

.link-copy-wrapper .btn {
    background: #fff;
    color: #667eea;
}

.link-copy-wrapper .btn:hover {
    background: #f0f0f0;
}

/* Grid de Estatísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stat-card.highlight {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2ff;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
    stroke: #667eea;
}

.stat-card.highlight .stat-icon {
    background: rgba(255,255,255,0.2);
}

.stat-card.highlight .stat-icon svg {
    stroke: #fff;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    opacity: 0.7;
}

/* Resumo Financeiro */
.financial-summary {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.financial-summary h3 {
    margin: 0 0 20px;
    font-size: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.summary-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.summary-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.summary-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.summary-value.pending {
    color: #f0ad4e;
}

.summary-value.paid {
    color: #11998e;
}

.minimum-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Gráfico */
.chart-section {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.chart-section h3 {
    margin: 0 0 20px;
}

.chart-section canvas {
    max-height: 300px;
}

/* Seção de Links */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
}

.link-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.link-form h4 {
    margin: 0 0 20px;
}

/* Formulários */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-help {
    margin: 8px 0 0;
    font-size: 13px;
    color: #888;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.form-section h4 {
    margin: 0 0 20px;
    color: #1a1a1a;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.form-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

/* Tabelas */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th,
.data-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    font-weight: 600;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.link-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.link-input {
    flex: 1;
    padding: 8px 12px !important;
    font-size: 12px !important;
    background: #f8f9fa !important;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 8px;
    background: #e1e5eb;
    border-radius: 4px;
    font-size: 11px;
    color: #666;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved,
.status-active,
.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-rejected,
.status-suspended {
    background: #f8d7da;
    color: #721c24;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    color: #666;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #eee;
}

.payout-details p {
    margin: 10px 0;
}

/* Formulário de Login/Registro */
.myragen-register-form,
.myragen-login-form {
    max-width: 600px;
    margin: 40px auto;
    padding: 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.myragen-register-form h2,
.myragen-login-form h2 {
    margin: 0 0 10px;
    text-align: center;
    font-size: 28px;
}

.form-intro {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

.required {
    color: #dc3545;
}

/* Profile Form */
.profile-form {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

/* Responsivo */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .quick-actions {
        width: 100%;
        justify-content: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-nav {
        overflow-x: auto;
    }

    .nav-item {
        white-space: nowrap;
        padding: 10px 16px;
    }

    .link-copy-wrapper {
        flex-direction: column;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .myragen-register-form,
    .myragen-login-form {
        margin: 20px;
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-tab.active {
    animation: fadeIn 0.3s ease;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background: #333;
    color: #fff;
    border-radius: 8px;
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #11998e;
}

.toast.error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
