/* 
 * AppPlan AI - Estilos Premium Personalizados
 * Estilo: Clean Light Mode & Soft Pastel Aesthetics (Inspirado en Bankio)
 */

:root {
    --bg-main: #eef2f6;
    --bg-card: #ffffff;
    --bg-darker: #f8fafc;
    --border-glass: rgba(0, 0, 0, 0.05);
    --border-focus: #5c86f0;

    --color-primary: #5c86f0;
    --color-cyan: #0ea5e9;
    --color-success: #15803d;
    --color-warning: #b45309;
    --color-danger: #b91c1c;

    --gradient-accent: linear-gradient(135deg, #5c86f0 0%, #0ea5e9 100%);
    --gradient-glow: linear-gradient(135deg, rgba(92, 134, 240, 0.15) 0%, rgba(14, 165, 233, 0.15) 100%);

    --color-text: #0f172a;
    --color-text-muted: #475569;
    --color-text-light: #64748b;
}

/* Base resets */
body {
    background-color: var(--bg-main);
    color: var(--color-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.22);
}

/* Typography Helpers & Color Overrides for Light Mode Compatibility */
.text-light {
    color: var(--color-text) !important;
}

.text-light-50 {
    color: var(--color-text-muted) !important;
}

.text-white {
    color: var(--color-text) !important;
}

.text-muted {
    color: var(--color-text-light) !important;
}

.text-gradient {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-glow {
    text-shadow: 0 4px 15px rgba(92, 134, 240, 0.15);
}

.fw-extrabold {
    font-weight: 800;
}

/* Navbar Premium Light Mode */
.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    padding: 15px 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--color-text) !important;
}

.logo-icon {
    font-size: 1.6rem;
    color: var(--color-primary);
}

.logo-accent {
    color: var(--color-cyan);
}

.nav-link {
    color: var(--color-text-muted) !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--color-text) !important;
}

.navbar-text {
    color: var(--color-text-muted) !important;
}

/* Buttons */
.btn-accent {
    background: var(--gradient-accent);
    color: white !important;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(92, 134, 240, 0.35);
    color: white !important;
}

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

.shadow-glow {
    box-shadow: 0 4px 20px rgba(92, 134, 240, 0.15);
}

.btn-success-glow {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white !important;
    border: none;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-success-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
    color: white !important;
}

.btn-outline-light {
    border-color: #cbd5e1 !important;
    color: var(--color-text-muted) !important;
    background: transparent !important;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-outline-light:hover {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: var(--color-text) !important;
}

/* Glassmorphism/Neumorphic Cards */
.glass-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02) !important;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05), 0 0 20px rgba(92, 134, 240, 0.05) !important;
    border-color: rgba(92, 134, 240, 0.2) !important;
}

.bg-dark-card {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

/* Custom Alert Badges */
.bg-success-glow {
    background: #e6f4ea !important;
    color: #137333 !important;
    border: 1px solid rgba(22, 101, 52, 0.15) !important;
    border-radius: 8px;
    font-weight: 600;
    padding: 6px 12px;
}

.bg-warning-glow {
    background: #fef7e0 !important;
    color: #b06000 !important;
    border: 1px solid rgba(180, 83, 9, 0.15) !important;
    border-radius: 8px;
    font-weight: 600;
    padding: 6px 12px;
}

.bg-danger-glow {
    background: #fce8e6 !important;
    color: #c5221f !important;
    border: 1px solid rgba(185, 28, 28, 0.15) !important;
    border-radius: 8px;
    font-weight: 600;
    padding: 6px 12px;
}

.bg-indigo-glow {
    background: #e8ebfa !important;
    color: #3c54d9 !important;
    border: 1px solid rgba(99, 102, 241, 0.15) !important;
    border-radius: 8px;
    font-weight: 600;
    padding: 6px 12px;
}

/* Alerts custom style */
.alert-custom-danger {
    background: #fce8e6;
    border: 1px solid rgba(185, 28, 28, 0.15);
    color: #c5221f;
    border-radius: 12px;
}

.alert-custom-success {
    background: #e6f4ea;
    border: 1px solid rgba(22, 101, 52, 0.15);
    color: #137333;
    border-radius: 12px;
}

.alert-warning.glass-card {
    background: #fef7e0 !important;
    border: 1px solid rgba(180, 83, 9, 0.15) !important;
    color: #b06000 !important;
}

.alert-warning.glass-card .text-light,
.alert-warning.glass-card .text-muted {
    color: #b06000 !important;
}

/* Inputs and Forms */
.form-control,
.form-select {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--color-text) !important;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 3px rgba(92, 134, 240, 0.15) !important;
    outline: none;
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-text {
    font-size: 0.82rem;
    color: var(--color-text-light) !important;
}

/* Custom Bootstrap Tables */
.table-dark-custom {
    background: transparent !important;
    margin-bottom: 0;
}

.table-dark-custom th {
    background: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
    color: var(--color-text-light);
    text-transform: uppercase;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 15px;
}

.table-dark-custom td {
    background: transparent !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 18px 15px;
    color: var(--color-text-muted);
}

.table-dark-custom tr:last-child td {
    border-bottom: none;
}

/* Tabs styling */
.nav-tabs {
    border-bottom: 1px solid #e2e8f0 !important;
}

.nav-tabs .nav-link {
    background: transparent !important;
    border: none !important;
    color: var(--color-text-light) !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 20px;
    transition: all 0.2s ease;
    border-radius: 8px 8px 0 0;
}

.nav-tabs .nav-link.active {
    color: var(--color-text) !important;
    border-bottom: 3px solid var(--color-primary) !important;
    background: rgba(92, 134, 240, 0.05) !important;
}

.nav-tabs .nav-link:hover:not(.active) {
    color: var(--color-text-muted) !important;
    background: rgba(0, 0, 0, 0.02);
}

/* Markdown view output */
.markdown-body {
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--color-text-muted);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    color: var(--color-text);
    font-weight: 700;
    margin-top: 1.6rem;
    margin-bottom: 0.8rem;
}

.markdown-body h1 {
    font-size: 1.6rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.markdown-body h2 {
    font-size: 1.4rem;
}

.markdown-body h3 {
    font-size: 1.2rem;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 20px;
    margin-bottom: 1rem;
}

.markdown-body pre {
    background-color: #f8fafc !important;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    margin: 1.2rem 0;
}

.markdown-body code {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88rem;
    background-color: #f1f5f9;
    color: #d946ef;
    padding: 2px 6px;
    border-radius: 4px;
}

.markdown-body pre code {
    background-color: transparent;
    color: var(--color-text-muted);
    padding: 0;
}

/* Code area */
.code-block {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85rem;
}

#rawMarkdownTextarea {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88rem;
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: var(--color-text) !important;
    line-height: 1.5;
}

/* Spinner Custom Animation */
.spinner-container {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100px;
    height: 100px;
    position: relative;
}

.custom-spinner {
    width: 70px;
    height: 70px;
    border: 4px solid rgba(92, 134, 240, 0.1);
    border-left-color: var(--color-primary);
    border-right-color: var(--color-cyan);
    border-radius: 50%;
    animation: spinRing 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    box-shadow: 0 0 20px rgba(92, 134, 240, 0.15);
}

@keyframes spinRing {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.bg-gradient-accent {
    background: var(--gradient-accent);
}

/* Layout Utilities */
.card-icon-round {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-glass);
    margin-top: auto;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.02);
}

.footer-brand {
    font-weight: 800;
    color: var(--color-text);
}

.max-w-600 {
    max-width: 600px;
}

.max-w-500 {
    max-width: 500px;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .display-3 {
        font-size: 2.5rem;
    }

    .table-dark-custom th,
    .table-dark-custom td {
        padding: 10px;
    }
}

/* SaaS Specific Premium Styles */
.hover-scale {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04), 0 0 30px rgba(92, 134, 240, 0.12) !important;
    border-color: rgba(92, 134, 240, 0.3) !important;
}

.border-warning-glow {
    border: 1px solid rgba(245, 158, 11, 0.15) !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.05);
}

.border-left-warning {
    border-left: 4px solid #f59e0b !important;
}

.border-left-success {
    border-left: 4px solid #10b981 !important;
}

.border-left-info {
    border-left: 4px solid #06b6d4 !important;
}

.border-left-danger {
    border-left: 4px solid #ef4444 !important;
}

.font-monospace {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
}

/* Card custom layouts based on reference image */
.card.glass-card {
    padding: 1.5rem;
}

/* Custom background graphics / soft circles as reference */
.glowing-orb {
    display: none; /* Hide dark glowing orbs */
}

/* Sutil shadow tweaks for card statistics */
.display-5.fw-extrabold {
    color: var(--color-text) !important;
}
.display-6.fw-extrabold {
    color: var(--color-text) !important;
}

/* Background image style for pricing cards based on bankio reference */
.card.glass-card.d-flex.flex-column.text-center:nth-child(even) {
    background: #e8ebfa !important;
}

.card.glass-card.d-flex.flex-column.text-center:nth-child(3) {
    background: #e6f4ea !important;
}