/* ============================================
   CSS CONSOLIDADO - Gerenciar Produtos
   Consolidado de: index.php, cadastrar_produto.php, editar_produto.php
   ============================================ */

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

html {
    height: 100%;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0a192f 0%, #112240 100%);
    background-attachment: fixed;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0a192f 0%, #112240 100%);
    background-attachment: fixed;
    color: #e9edf1;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Container Principal (index.php) */
.container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    width: 100%;
}

/* Container para views incluídas (cadastrar_produto.php, editar_produto.php) */
#view-cadastrar .container,
#view-editar-produto .container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
}

/* Quando cadastrar_produto.php é incluído, .steps-sidebar e .main-content precisam de um wrapper grid */
#conteudo-cadastrar-produto {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    width: 100%;
}

#view-editar-produto .container {
    width: 100% !important;
    max-width: none !important;
    min-width: 100% !important;
    margin: 0 !important;
    background: transparent;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* Menu Lateral */
.sidebar {
    background: rgba(10, 25, 47, 0.95);
    border-right: 1px solid rgba(100, 255, 218, 0.2);
    padding: 20px;
    position: sticky;
    top: 0;
    align-self: start;
    min-height: 100vh;
}

.sidebar h2 {
    color: #64ffda;
    margin-bottom: 30px;
    font-size: 1.3rem;
}

.menu-item {
    display: block;
    padding: 12px 15px;
    color: #8892b0;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.menu-item:hover,
.menu-item.active {
    background: rgba(100, 255, 218, 0.1);
    color: #64ffda;
    border-left: 3px solid #64ffda;
}

.menu-item i {
    margin-right: 10px;
    width: 20px;
}

/* Conteúdo Principal */
.main-content {
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    width: 100%;
}

.page-title {
    color: #64ffda;
    font-size: 2rem;
    margin-bottom: 30px;
}

/* Cards */
.card {
    background: rgba(10, 25, 47, 0.8);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.card h3 {
    color: #64ffda;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert.success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #10b981;
}

.alert.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

/* Formulários */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #8892b0;
    font-size: 0.95rem;
    font-weight: 500;
}

.form-group label.required::after {
    content: ' *';
    color: #ef4444;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(10, 25, 47, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
    color: #e9edf1;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group select option {
    background: #0a192f;
    color: #e9edf1;
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: #8892b0;
    font-size: 0.85rem;
}

.form-group label i {
    margin-right: 8px;
    color: #64ffda;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #64ffda;
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group .info-text {
    color: #64ffda;
    font-size: 0.85rem;
    margin-top: 8px;
    padding: 10px;
    background: rgba(100, 255, 218, 0.1);
    border-left: 3px solid #64ffda;
    border-radius: 4px;
}

.form-group .error-text {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 8px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* Botões */
.btn {
    background: linear-gradient(135deg, #64ffda 0%, #4cd6b9 100%);
    color: #0a192f;
    border: none;
    padding: 14px 35px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(100, 255, 218, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.5);
    padding: 8px 15px;
    font-size: 0.9rem;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.btn-secondary {
    background: rgba(136, 146, 176, 0.2);
    color: #8892b0;
    border: 1px solid rgba(136, 146, 176, 0.3);
}

.btn-secondary:hover {
    background: rgba(136, 146, 176, 0.3);
    color: #e9edf1;
}

.buttons-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: space-between;
}

/* Lista de Produtos */
.produtos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.produto-card {
    background: rgba(10, 25, 47, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
    padding: 0;
    transition: all 0.3s;
    overflow: hidden;
    max-width: 260px;
    width: 260px;
    margin: 0 auto;
}

.produto-card:hover {
    border-color: #64ffda;
    transform: translateY(-2px);
}

.produto-card-imagem {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(100, 255, 218, 0.2);
    display: block;
    margin: 5px auto;
}

.produto-card-sem-imagem {
    width: 250px;
    height: 250px;
    background: rgba(100, 255, 218, 0.05);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8892b0;
    font-size: 0.9rem;
    margin: 5px auto;
}

.produto-card-conteudo {
    padding: 20px;
}

.produto-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.produto-card-actions-inline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #9ca3af;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.btn-icon:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(96, 165, 250, 0.8);
    color: #e5e7eb;
    transform: translateY(-1px);
}

.btn-icon-danger {
    border-color: rgba(248, 113, 113, 0.6);
    color: #fecaca;
}

.btn-icon-danger:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.9);
    color: #fee2e2;
}

.icone-pagina-vendas {
    color: #64ffda;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Produto info (editar_produto.php) */
.form-produto-info {
    display: block;
}

.form-produto-info .info-card {
    margin-bottom: 16px;
}

.form-produto-info-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1.2fr;
    gap: 16px;
}

.produto-info-field {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
}

/* Grid positions para produto-info */
.produto-info-nome {
    grid-column: 1 / span 2; /* linha 1, col 1-2 */
}

.produto-info-categoria {
    grid-column: 3 / span 1; /* linha 1, col 3 */
}

.produto-info-descricao {
    grid-column: 1 / span 1; /* linha 2, col 1 */
}

.produto-info-link-entrega {
    grid-column: 2 / span 1; /* linha 2, col 2 */
}

.produto-info-link-pv {
    grid-column: 3 / span 1; /* linha 2, col 3 */
}

.produto-info-field label {
    display: block;
    color: #e5e7eb;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.produto-info-field .view-value {
    color: #9ca3af;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    text-align: left !important;
    display: block;
    margin: 0;
}

.produto-info-field textarea,
.produto-info-field input,
.produto-info-field select {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    background: rgba(11, 13, 18, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #e5e7eb;
    font-size: 0.9rem;
}

/* Modo visual x edição */
.form-produto-info:not(.edit-mode) .edit-field {
    display: none;
}

.form-produto-info.edit-mode .view-value {
    display: none;
}

.form-produto-info .btn-produto-save {
    display: none;
}

.form-produto-info.edit-mode .btn-produto-save {
    display: inline-flex;
}

.form-produto-info.edit-mode .btn-produto-edit {
    display: none;
}

.produto-card h4 {
    color: #64ffda;
    margin-bottom: 10px;
}

.produto-card p {
    color: #8892b0;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.produto-card .status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.produto-card .status.ativo {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.produto-card .status.inativo {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.produto-card .actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Lista de Planos */
.plano-item {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plano-item:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.plano-item .plano-info {
    flex: 1;
    min-width: 0;
}

.plano-info h4 {
    color: #64ffda;
    margin-bottom: 5px;
}

.plano-info p {
    color: #8892b0;
    font-size: 0.85rem;
}

.plano-item .plano-nome {
    color: #10b981;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Grupo de menu com submenu (Meus Produtos: Sou Produtor / Sou Aluno) */
.menu-item-group {
    margin-bottom: 8px;
}

.menu-item-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    background: transparent;
    border: none;
    color: #e5e7eb;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 0.95rem;
}

.menu-item-toggle:hover {
    background-color: rgba(37, 99, 235, 0.25);
}

.menu-subitems {
    display: none;
    flex-direction: column;
    margin-left: 6px;
    border-left: 1px solid rgba(148, 163, 184, 0.3);
    padding-left: 8px;
}

.menu-subitems .menu-item {
    font-size: 0.9rem;
    padding-left: 24px;
}

.plano-item .plano-detalhes {
    color: #8892b0;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.plano-item .plano-valor {
    color: #10b981;
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
}

.plano-badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.25);
    color: #10b981;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sem-planos {
    color: #8892b0;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.plano-item.inativo {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    opacity: 0.7;
}

.plano-item.inativo .plano-nome,
.plano-item.inativo .plano-valor {
    color: #ef4444;
}

.plano-actions {
    display: flex;
    gap: 8px;
    margin-left: 0;
    justify-content: flex-end;
    flex-shrink: 0;
}

.btn-plano {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-inativar {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.btn-inativar:hover {
    background: rgba(239, 68, 68, 0.3);
}

.btn-editar {
    background: rgba(100, 255, 218, 0.2);
    color: #64ffda;
    border: 1px solid rgba(100, 255, 218, 0.5);
}

.btn-editar:hover {
    background: rgba(100, 255, 218, 0.3);
}

.btn-salvar {
    background: linear-gradient(135deg, #64ffda 0%, #4cd6b9 100%);
    color: #0a192f;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.btn-salvar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 255, 218, 0.4);
}

.btn-adicionar {
    background: linear-gradient(135deg, #64ffda 0%, #4cd6b9 100%);
    color: #0a192f;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-adicionar:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(100, 255, 218, 0.3);
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Steps Sidebar (cadastrar_produto.php) */
.steps-sidebar {
    background: rgba(10, 25, 47, 0.95);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 12px;
    padding: 20px 15px;
    height: fit-content;
    position: sticky;
    top: 20px;
    width: 220px;
}

.steps-sidebar h2 {
    color: #64ffda;
    margin-bottom: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.step-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: rgba(10, 25, 47, 0.4);
    border: 2px solid rgba(100, 255, 218, 0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.step-item:not(.locked):hover {
    background: rgba(100, 255, 218, 0.05);
    border-color: rgba(100, 255, 218, 0.3);
    transform: translateX(3px);
}

.step-item.active {
    background: rgba(100, 255, 218, 0.1);
    border-color: #64ffda;
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.2);
}

.step-item.completed {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

.step-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.step-item.locked:hover {
    transform: none;
    background: rgba(10, 25, 47, 0.4);
    border-color: rgba(100, 255, 218, 0.1);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(100, 255, 218, 0.2);
    color: #64ffda;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    margin-right: 10px;
    flex-shrink: 0;
}

.step-item.active .step-number {
    background: #64ffda;
    color: #0a192f;
}

.step-item.completed .step-number {
    background: #10b981;
    color: #fff;
}

.step-item.locked .step-number {
    background: rgba(136, 146, 176, 0.2);
    color: #8892b0;
}

.step-info h3 {
    color: #64ffda;
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.step-item.completed .step-info h3 {
    color: #10b981;
}

.step-item.locked .step-info h3 {
    color: #8892b0;
}

.step-info p {
    color: #8892b0;
    font-size: 0.75rem;
    line-height: 1.3;
}

.step-item.completed .step-info p {
    color: #a7f3d0;
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

.step-header {
    margin-bottom: 30px;
}

.step-header h1 {
    color: #64ffda;
    font-size: 2rem;
    margin-bottom: 10px;
}

.step-header p {
    color: #8892b0;
    font-size: 1rem;
}

/* Welcome Headline */
.welcome-headline {
    background: linear-gradient(135deg, rgba(100, 255, 218, 0.1) 0%, rgba(100, 255, 218, 0.05) 100%);
    border-left: 4px solid #64ffda;
    padding: 20px 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.welcome-headline h2 {
    color: #64ffda;
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
    line-height: 1.4;
}

.welcome-headline h2 .user-name {
    color: #fff;
    font-weight: 700;
}

/* Botões de Tempo de Acesso */
.tempo-acesso-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.tempo-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    background: rgba(10, 25, 47, 0.6);
    border: 2px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
    color: #8892b0;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.tempo-btn:hover {
    border-color: #64ffda;
    color: #64ffda;
    background: rgba(100, 255, 218, 0.05);
}

.tempo-btn.active {
    background: rgba(100, 255, 218, 0.1);
    border-color: #64ffda;
    color: #64ffda;
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.2);
}

/* Checkbox Plano Recorrente */
.checkbox-recorrente-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-recorrente-wrapper span {
    color: #8892b0;
    font-size: 0.95rem;
}

.checkbox-recorrente {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(10, 25, 47, 0.6);
    border: 2px solid rgba(100, 255, 218, 0.3);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s;
    margin: 0;
    padding: 0;
}

.checkbox-recorrente:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.checkbox-recorrente:checked {
    background: #10b981;
    border-color: #10b981;
}

.checkbox-recorrente:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 3px 3px 0;
    border-radius: 2px;
}

.checkbox-recorrente:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* Image Upload */
.image-upload-area {
    border: 2px dashed rgba(100, 255, 218, 0.3);
    border-radius: 8px;
    padding: 0;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(10, 25, 47, 0.4);
    position: relative;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.image-upload-area:hover {
    border-color: #64ffda;
    background: rgba(100, 255, 218, 0.05);
}

.image-upload-area.dragover {
    border-color: #64ffda;
    background: rgba(100, 255, 218, 0.1);
}

.image-upload-area input[type="file"] {
    display: none;
}

.image-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    width: 100%;
    height: 100%;
}

.image-upload-icon {
    font-size: 3rem;
    color: #64ffda;
    margin-bottom: 15px;
}

.image-upload-text {
    color: #64ffda;
    font-size: 1rem;
    margin-bottom: 10px;
}

.image-upload-hint {
    color: #8892b0;
    font-size: 0.85rem;
}

.image-preview {
    position: relative;
    width: 300px;
    height: 300px;
    min-width: 300px;
    min-height: 300px;
    max-width: 300px;
    max-height: 300px;
    display: none;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.image-preview img {
    width: 300px;
    height: 300px;
    min-width: 300px;
    min-height: 300px;
    max-width: 300px;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.image-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    gap: 10px;
}

.image-preview-overlay i {
    font-size: 2rem;
    color: #64ffda;
}

.image-preview:hover .image-preview-overlay {
    opacity: 1;
}

/* Info Box */
.info-box {
    background: rgba(100, 255, 218, 0.1);
    border-left: 4px solid #64ffda;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 25px;
}

.info-box p {
    color: #8892b0;
    font-size: 0.9rem;
    margin: 0;
}

/* Formulários de Plano */
.form-editar-plano {
    margin-top: 20px;
    background: rgba(10, 25, 47, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-editar-plano-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
    background: rgba(100, 255, 218, 0.05);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.form-editar-plano-header:hover {
    background: rgba(100, 255, 218, 0.1);
}

.form-editar-plano-header:active,
.form-editar-plano-header:focus {
    outline: none;
}

.form-editar-plano-header h4 {
    color: #64ffda;
    font-size: 0.9rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-editar-plano-header i.fa-chevron-down {
    transition: transform 0.3s;
    color: #64ffda;
}

.form-editar-plano-header.expanded i.fa-chevron-down {
    transform: rotate(180deg);
}

.form-editar-plano-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease-out;
    opacity: 0;
}

.form-editar-plano-content.expanded {
    max-height: 9999px; /* permite que o plano-item cresça para acomodar o checkout inteiro */
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease-in;
    opacity: 1;
}

.form-editar-plano-form {
    padding: 20px;
}

.form-adicionar-plano {
    margin-top: 20px;
    background: rgba(10, 25, 47, 0.4);
    border: 1px dashed rgba(100, 255, 218, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.form-adicionar-plano-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

.form-adicionar-plano-header:hover {
    background: rgba(100, 255, 218, 0.05);
}

.form-adicionar-plano-header h4 {
    color: #64ffda;
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-adicionar-plano-header i.fa-chevron-down {
    transition: transform 0.3s;
}

.form-adicionar-plano-header.expanded i.fa-chevron-down {
    transform: rotate(180deg);
}

.form-adicionar-plano-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.form-adicionar-plano-content.expanded {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
}

.form-adicionar-plano-form {
    padding: 0 20px 20px 20px;
}

.form-group-plano {
    margin-bottom: 20px;
}

.form-group-plano:last-child {
    margin-bottom: 0;
}

.form-group-plano label {
    display: block;
    color: #8892b0;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group-plano input[type="text"],
.form-group-plano input[type="url"],
.form-group-plano input[type="number"],
.form-group-plano textarea,
.form-group-plano input,
.form-group-plano textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(10, 25, 47, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 6px;
    color: #e9edf1;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group-plano input[type="text"]:focus,
.form-group-plano input[type="url"]:focus,
.form-group-plano input[type="number"]:focus,
.form-group-plano textarea:focus,
.form-group-plano input:focus,
.form-group-plano textarea:focus {
    outline: none;
    border-color: #64ffda;
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.1);
}

.form-group-plano textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group-plano small {
    display: block;
    color: #8892b0;
    font-size: 0.8rem;
    margin-top: 6px;
    line-height: 1.4;
}

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

/* Diagrama de Afiliação */
.diagrama-afiliacao {
    margin-top: 20px;
    background: rgba(10, 25, 47, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.diagrama-afiliacao-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

.diagrama-afiliacao-header:hover {
    background: rgba(100, 255, 218, 0.05);
}

.diagrama-afiliacao-header h4 {
    color: #64ffda;
    font-size: 0.95rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.diagrama-afiliacao-header i.fa-chevron-down {
    transition: transform 0.3s;
    color: #64ffda;
}

.diagrama-afiliacao-header.expanded i.fa-chevron-down {
    transform: rotate(180deg);
}

.diagrama-afiliacao-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.diagrama-afiliacao-content.expanded {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
}

.diagrama-afiliacao-inner {
    padding: 20px;
}

.diagrama-afiliacao-inner h4 {
    color: #64ffda;
    font-size: 0.95rem;
    margin-bottom: 15px;
    text-align: center;
}

.diagrama-linha {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.diagrama-pessoa {
    background: rgba(10, 25, 47, 0.8);
    border: 2px solid;
    border-radius: 8px;
    padding: 12px 15px;
    text-align: center;
    min-width: 120px;
    position: relative;
}

.diagrama-pessoa.produtor {
    border-color: #64ffda;
    background: rgba(100, 255, 218, 0.1);
}

.diagrama-pessoa.recrutador {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.diagrama-pessoa.cliente {
    border-color: #8892b0;
    background: rgba(136, 146, 176, 0.1);
}

.diagrama-pessoa .nome {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.diagrama-pessoa.produtor .nome {
    color: #64ffda;
}

.diagrama-pessoa.recrutador .nome {
    color: #10b981;
}

.diagrama-pessoa.cliente .nome {
    color: #8892b0;
}

.diagrama-pessoa .tipo {
    font-size: 0.75rem;
    color: #8892b0;
    text-transform: uppercase;
}

.diagrama-seta {
    color: #64ffda;
    font-size: 1.5rem;
    margin: 0 5px;
}

.diagrama-comissao {
    margin-top: 10px;
    padding: 10px;
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid #10b981;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #10b981;
}

.diagrama-cenarios {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.diagrama-cenario {
    padding: 15px;
    background: rgba(10, 25, 47, 0.4);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 6px;
}

.diagrama-cenario h5 {
    color: #64ffda;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.diagrama-cenario p {
    color: #8892b0;
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 5px 0;
}

/* Editar Produto - Estilos Específicos */
.header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(100, 255, 218, 0.2);
}

.header h1 {
    color: #64ffda;
    font-size: 2rem;
    margin-bottom: 10px;
}

.header p {
    color: #8892b0;
    font-size: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 24px;
    margin-top: 20px;
    width: 100% !important;
    max-width: none !important;
    min-width: 100% !important;
    align-items: start;
}

.planos-card {
    grid-column: 1 / -1;
}

.produto-imagem {
    background: rgba(10, 25, 47, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
    padding: 4px 4px 12px 4px; /* 4px de padding menos 2px da borda da imagem = 2px de margem visual */
    text-align: center;
    height: fit-content;
    position: static;
}

.produto-imagem img {
    width: 200px;
    height: 200px;
    object-fit: cover; /* 1:1 mantendo preenchimento */
    border-radius: 8px;
    border: 2px solid rgba(100, 255, 218, 0.3);
}

.produto-imagem .sem-imagem {
    width: 200px;
    height: 200px;
    background: rgba(100, 255, 218, 0.1);
    border: 2px dashed rgba(100, 255, 218, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8892b0;
    font-size: 0.9rem;
}

/* Garantir que a imagem fique centralizada dentro do container clicável */
#container-imagem-clicavel {
    width: 200px !important;
    height: 200px !important;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.produto-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.info-card {
    background: rgba(10, 25, 47, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
    padding: 25px;
}

.info-card h3 {
    color: #64ffda;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.info-card .valor {
    color: #10b981;
    font-size: 1.8rem;
    font-weight: 700;
}

.info-card .texto {
    color: #e9edf1;
    font-size: 1.1rem;
    font-weight: 500;
}

.info-card .categoria {
    color: #64ffda;
    font-size: 1rem;
    font-weight: 500;
}

.planos-lista {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Views incluídas */
#view-cadastrar {
    width: 100%;
    overflow: auto;
}

#view-editar-produto {
    width: 100% !important;
    max-width: none !important;
}

#conteudo-editar-produto {
    width: 100% !important;
    max-width: none !important;
    padding: 20px;
    box-sizing: border-box;
}

/* Quando editar_produto.php é incluído, o conteúdo não tem .container */
#conteudo-editar-produto > .header,
#conteudo-editar-produto > .info-grid {
    width: 100%;
}

#conteudo-editar-produto > .header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(100, 255, 218, 0.2);
}

#conteudo-editar-produto > .header h1 {
    color: #64ffda;
    font-size: 2rem;
    margin-bottom: 10px;
}

#conteudo-editar-produto > .header p {
    color: #8892b0;
    font-size: 1rem;
}

#conteudo-editar-produto > .info-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
    margin-top: 20px;
    width: 100% !important;
    max-width: none !important;
    min-width: 100% !important;
}

/* Editar Plano - Formulário principal */
.form-editar-plano-form {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-editar-plano-form .form-group-plano {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-editar-plano-form label {
    color: #e9edf1;
    font-weight: 600;
}

.form-editar-plano-form input,
.form-editar-plano-form select,
.form-editar-plano-form textarea {
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #e9edf1;
    border-radius: 8px;
    padding: 10px;
}

.form-editar-plano-form input:focus,
.form-editar-plano-form select:focus,
.form-editar-plano-form textarea:focus {
    border-color: #64ffda;
    outline: none;
    box-shadow: 0 0 0 2px rgba(100, 255, 218, 0.15);
}

.form-editar-plano-form small {
    color: #8fa3bf;
    font-size: 0.85rem;
}

.form-editar-plano-form .checkbox-recorrente-wrapper span,
.form-editar-plano-form .checkbox-label span {
    color: #e9edf1;
    font-size: 0.9rem; /* texto das checkbox levemente menor */
}

.form-editar-plano-form .form-group-plano h4 {
    color: #e9edf1;
    margin: 0;
}

.form-editar-plano-form .form-group-plano .highlight-info {
    color: #e9edf1;
    font-weight: 600;
}

/* Toggle ON/OFF usando wrapper .switch e span.slider (estilo pill) */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
}

.switch input {
    display: none; /* esconde o checkbox real */
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    background-color: #e11d48; /* OFF */
    border-radius: 999px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: 0.25s;
}

.switch .slider::after {
    content: "OFF";
    position: absolute;
    right: 8px; /* texto OFF encostado mais à direita */
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    font-weight: bold;
    font-size: 10px; /* texto ON/OFF um pouco menor */
    font-family: Arial, sans-serif;
    letter-spacing: 0.5px;
    transition: 0.3s;
}

.switch .slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    top: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: 0.25s;
}

/* ON */
.switch input:checked + .slider {
    background-color: #22c55e;
}

.switch input:checked + .slider::before {
    transform: translateX(24px);
}

.switch input:checked + .slider::after {
    content: "ON";
    left: 8px;  /* texto ON encostado mais à esquerda */
    right: auto;
}

/* Responsive */
@media (max-width: 1200px) {
    .info-grid {
        grid-template-columns: 300px 1fr;
        gap: 30px;
    }
}

@media (max-width: 968px) {
    .container {
        grid-template-columns: 220px 1fr;
    }

    .sidebar {
        min-height: auto;
    }

    .two-columns {
        grid-template-columns: 1fr;
    }

    #view-cadastrar .container {
        grid-template-columns: 1fr;
    }

    .steps-sidebar {
        position: relative;
        top: 0;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .produto-imagem {
        position: relative;
        top: 0;
    }

    .diagrama-cenarios {
        grid-template-columns: 1fr;
    }

    .diagrama-linha {
        flex-direction: column;
    }

    .diagrama-seta {
        transform: rotate(90deg);
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        min-height: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .plano-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .plano-actions {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
}

