/* ================================================
    Sistema GoBio - Estilos Globais
   Design Moderno, Responsivo e Atraente
   ================================================ */

/* ===== RESET E BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores Principais */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    
    /* Cores Neutras */
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-light: #f8fafc;
    --text-light: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #94a3b8;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* Transições */
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
}

/* ===== PÁGINAS DE AUTENTICAÇÃO - DESIGN MODERNO ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124,58,237,0.15), transparent 70%);
    top: -200px;
    right: -200px;
    animation: float 15s ease-in-out infinite;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(6,182,212,0.12), transparent 70%);
    bottom: -250px;
    left: -250px;
    animation: float 20s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(30px, -30px) rotate(5deg); }
}

.auth-container {
    width: 100%;
    max-width: 950px;
    position: relative;
    z-index: 10;
}

.auth-card {
    background: rgba(15, 15, 35, 0.92);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
}

.auth-card-inner {
    display: grid;
    grid-template-columns: 45% 55%;
    min-height: 550px;
}

/* Painel Visual Lateral */
.auth-visual {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.visual-blob {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

.visual-brand {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.visual-brand h2 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.visual-brand p {
    font-size: 16px;
    opacity: 0.95;
    line-height: 1.6;
    max-width: 280px;
}

/* Área do Formulário */
.auth-form-area {
    padding: 60px 50px;
    background: rgba(15, 15, 35, 0.95);
}

.auth-header {
    margin-bottom: 36px;
    text-align: center;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
}

.auth-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.auth-form {
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 24px;
}

.auth-form-area .form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #ffffff;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-form-area .form-group input,
.auth-form-area .form-group select,
.auth-form-area .form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}

.auth-form-area .form-group input:focus,
.auth-form-area .form-group select:focus,
.auth-form-area .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.auth-form-area ::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.form-group input[type="color"] {
    height: 48px;
    cursor: pointer;
}

.form-group input[type="file"] {
    padding: 8px 12px;
}

.auth-form-area .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-form-area .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.auth-form-area .btn-primary:active {
    transform: translateY(0);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Alerts dentro do auth */
.auth-form-area .alert {
    border-radius: 12px;
    margin-bottom: 24px;
}

.auth-form-area .alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.auth-form-area .alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* Responsividade */
@media (max-width: 900px) {
    .auth-card-inner {
        grid-template-columns: 1fr;
    }
    
    .auth-visual {
        display: none;
    }
    
    .auth-form-area {
        padding: 40px 30px;
    }
}

@media (max-width: 500px) {
    .auth-form-area {
        padding: 30px 20px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
}

/* ===== ALERTAS ===== */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ===== BOTÕES ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-icon {
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-icon:hover {
    background: #f1f5f9;
}

.btn-icon.btn-danger:hover {
    background: #fee2e2;
}

/* ===== DASHBOARD ===== */
.dashboard-page {
    display: flex;
    min-height: 100vh;
    background: #f8fafc;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-dark);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 32px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 800;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    margin-bottom: 8px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item .icon {
    font-size: 20px;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.user-plan {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Conteúdo Principal */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 32px;
}

.content-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
}

.content-header p {
    color: var(--text-muted);
    font-size: 16px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Pages Grid */
.pages-section {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.pages-grid {
    display: grid;
    /* Máximo de 3 cards lado a lado; responsivo para 2 e 1 coluna */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

@media (max-width: 1000px) {
    .pages-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .pages-grid {
        grid-template-columns: 1fr;
    }
}

.page-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
}

.page-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.page-card-header {
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.page-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
}

.page-thumbnail-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    border: 4px solid white;
}

.page-card-body {
    padding: 20px;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-dark {
    background: #1e293b;
    color: white;
}

.badge-light {
    background: #f8fafc;
    color: #1e293b;
}

.page-url {
    font-size: 13px;
    color: var(--text-muted);
    word-break: break-all;
}

.page-url a {
    color: var(--primary);
    text-decoration: none;
}

.page-url a:hover {
    text-decoration: underline;
}

.page-card-footer {
    padding: 16px 20px;
    background: #f8fafc;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

/* Melhorias visuais para os botões dentro dos cards */
.page-card-footer .btn {
    border-radius: 12px;
    padding: 10px 14px;
    min-width: 56px;
    box-shadow: 0 4px 8px rgba(16,24,40,0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px; /* espaço entre ícone e texto */
    white-space: nowrap;
}

.page-card-footer .btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(16,24,40,0.12);
}

.page-card-footer .btn-outline {
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.page-card-footer .btn-outline:hover {
    background: var(--primary);
    color: white;
}

.page-card-footer .btn-sm {
    padding: 8px 12px;
    font-size: 14px;
}

.page-card-footer .btn-danger {
    border-radius: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 64px 32px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.empty-state-small {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
}

/* Form Container */
.form-container {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    max-width: 900px;
}

.form-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e2e8f0;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-dark);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

/* Edit Container */
.edit-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
}

.edit-forms {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.edit-section {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.edit-sidebar {
    position: sticky;
    top: 32px;
    height: fit-content;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Links List */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: var(--transition);
    cursor: move;
}

.link-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.link-item-handle {
    color: var(--text-muted);
    cursor: grab;
    font-size: 18px;
}

.link-item-content {
    flex: 1;
}

.link-item-text {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.link-item-url {
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
}

.help-text {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* Delete Page */
.delete-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    padding: 20px;
}

.delete-card {
    background: white;
    border-radius: 24px;
    padding: 48px;
    max-width: 600px;
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.delete-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.delete-card h1 {
    font-size: 28px;
    margin-bottom: 12px;
}

.delete-info {
    background: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    margin: 24px 0;
}

.delete-info h3 {
    margin-bottom: 8px;
}

.delete-info p {
    color: var(--text-muted);
    font-size: 14px;
}

.delete-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 1024px) {
    .edit-container {
        grid-template-columns: 1fr;
    }
    
    .edit-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .dashboard-page {
        flex-direction: column;
    }
    
    .auth-container {
        grid-template-columns: 1fr;
    }
    
    .auth-demo {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .pages-grid {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
