/* ==========================================================
   🎨 Estilos - Ensina.app Frontend
   ========================================================== */

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

:root {
    --primary-color: #667eea;
    --primary-hover: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --border-color: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

body.profile-page {
    background: #f8fafc;
}

.hidden {
    display: none !important;
}


/* ==========================================================
   📦 Container e Layout
   ========================================================== */

.container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
}

/* ==========================================================
   🎴 Cards
   ========================================================== */

.card {
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px;
    animation: slideUp 0.5s ease-out;
}

.profile-page .card {
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    padding: 28px;
}

.profile-header-block {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

.profile-avatar.profile-avatar--placeholder {
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 24px;
    text-transform: uppercase;
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
}

.profile-email {
    font-size: 14px;
    color: #64748b;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 18px;
}

.profile-field-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.profile-field-value {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: #1e293b;
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.project-title {
    font-weight: 600;
    font-size: 16px;
    color: #1e293b;
}

.project-date {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.project-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.card-content {
    font-size: 14px;
    color: #475569;
}

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

.dashboard-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ==========================================================
   🎯 Logo e Cabeçalhos
   ========================================================== */

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: var(--text-primary);
    font-size: 32px;
    margin-bottom: 5px;
}

.logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==========================================================
   🔘 Botões
   ========================================================== */

.btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    margin-bottom: 15px;
    text-decoration: none;
}

.btn-google {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-google:hover {
    background: var(--bg-secondary);
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    min-height: 48px;
    font-size: 18px;
    padding: 14px 28px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-tertiary {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-tertiary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-small {
    width: auto;
    padding: 6px 12px;
    font-size: 12px;
    margin: 0;
}

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

.animate-fade-in {
    animation: fadeIn 0.2s forwards;
}

.animate-fade-out {
    animation: fadeOut 0.2s forwards;
}

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

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-card {
    background: #ffffff;
    border-radius: 18px;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.25);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #475569;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
}

.modal-subtitle {
    font-size: 14px;
    color: #64748b;
}

.modal-section {
    margin-top: 18px;
}

.modal-section-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 8px;
}

.modal-summary {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.5;
    white-space: pre-line;
}

.modal-note {
    margin-top: 10px;
    font-size: 13px;
    color: #475569;
}

.modal-note span {
    font-weight: 600;
    color: #1e293b;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
    margin-top: 12px;
}

.modal-grid dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 2px;
}

.modal-grid dd {
    font-size: 14px;
    color: #1e293b;
}

.modal-modules {
    list-style: none;
    margin-top: 14px;
    padding: 0;
    display: grid;
    gap: 10px;
}

.modal-module {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.modal-module-index {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1e293b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.modal-module-title {
    font-weight: 600;
    color: #0f172a;
}

.modal-module-description {
    font-size: 13px;
    color: #475569;
    margin: 4px 0;
}

.modal-module-meta {
    font-size: 12px;
    color: #64748b;
}

/* ==========================================================
   📝 Formulários
   ========================================================== */

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

.form-group label {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ==========================================================
   ➗ Divisor
   ========================================================== */

.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: var(--bg-primary);
    padding: 0 15px;
    color: var(--text-secondary);
    position: relative;
}

/* ==========================================================
   🔗 Links
   ========================================================== */

.links {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.links a {
    color: var(--primary-color);
    text-decoration: none;
}

.links a:hover {
    text-decoration: underline;
}

/* ==========================================================
   📊 Status e Alertas
   ========================================================== */

.auth-status {
    margin-top: 20px;
    padding: 15px;
    background: #eff6ff;
    border-radius: 8px;
    border-left: 4px solid var(--info-color);
}

.status-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-text {
    color: #1e40af;
    font-size: 14px;
}

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

.alert-success {
    background: #ecfdf5;
    border-left: 4px solid var(--success-color);
    color: #065f46;
}

.alert-error {
    background: #fef2f2;
    border-left: 4px solid var(--error-color);
    color: #991b1b;
}

.alert-info {
    background: #eff6ff;
    border-left: 4px solid var(--info-color);
    color: #1e40af;
}

/* ==========================================================
   🎯 Dashboard
   ========================================================== */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    background: var(--bg-primary);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.token-display {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    word-break: break-all;
    margin-bottom: 15px;
    border: 2px dashed var(--border-color);
}

/* ==========================================================
   🤖 Agentes
   ========================================================== */

.agent-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s;
}

.agent-item:hover {
    background: var(--bg-secondary);
}

.agent-item:last-child {
    border-bottom: none;
}

.agent-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.agent-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 5px;
}

.agent-endpoint {
    color: var(--text-secondary);
    font-size: 12px;
    font-family: monospace;
}

/* ==========================================================
   📱 Responsividade
   ========================================================== */

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .card {
        padding: 25px;
    }
}

