/* -------------------------------------------------
   QuieroPresupuestos - Consolidated & Optimized CSS
   ------------------------------------------------- */

/* 1. Root Variables */
:root {
    --primary-color: #2563eb;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-gradient: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);

    --bg-color: #f3f4f6;
    --surface-color: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Missing variables found in previous version */
    --qp-primary: #2563eb;
    --qp-primary-light: #38decb;
    --qp-footer-bg-start: #0b1021;
    --qp-footer-bg-end: #020617;
}

/* 2. Base & Global Styles */
* {
    box-sizing: border-box;
    font-family: 'Inter', 'Space Grotesk', system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

body.qp-public-body {
    background: linear-gradient(to bottom, var(--qp-footer-bg-start), var(--qp-footer-bg-end));
    color: #e8edf5;
}

main.qp-public-main {
    position: relative;
    z-index: 1;
}

main {
    animation: fadeIn 0.5s ease;
}

/* 3. Navigation Components */

/* Generic Navbar */
.navbar {
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 0;
}

.navbar-brand img {
    height: 64px;
    width: auto;
}

/* Public Nav Specific */
.qp-nav {
    backdrop-filter: blur(14px);
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.25);
    padding: 14px 18px;
}

/* Professional Navbar */
.navbar-professional {
    backdrop-filter: blur(10px);
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.navbar-professional.scrolled {
    box-shadow: var(--shadow-lg);
}

.navbar-professional .navbar-brand {
    background: var(--primary-gradient);
    background-clip: text;
    font-size: 1.5rem;
    font-weight: 700;
    transition: all 0.3s ease;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-professional .navbar-brand:hover {
    transform: translateY(-2px);
}

.navbar-professional .navbar-brand i {
    background: var(--primary-gradient);
    background-clip: text;
    font-size: 1.8rem;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Nav Link Utilities */
.nav-link {
    border-radius: 0.375rem;
    color: var(--text-secondary) !important;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem !important;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background-color: #f3f4f6;
    color: var(--text-primary) !important;
}

.qp-nav a.nav-link {
    color: #000 !important;
    letter-spacing: 0.01em;
    font-weight: bold;
}

.qp-nav a.nav-link:hover {
    color: var(--qp-primary) !important;
}

.navbar-professional .nav-link {
    border-radius: 8px;
    color: #4a5568 !important;
    margin: 0 0.25rem;
    padding: 0.5rem 1rem !important;
    position: relative;
}

.navbar-professional .nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea !important;
    transform: translateY(-2px);
}

.navbar-professional .nav-link.active {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea !important;
    font-weight: 600;
}

.navbar-professional .nav-link.active::after {
    background: var(--primary-gradient);
    border-radius: 2px;
    bottom: 0;
    content: '';
    height: 3px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 30px;
}

/* Brand & User Dropdowns */
.qp-brand {
    align-items: center;
    display: flex;
    gap: 10px;
}

.qp-brand img {
    filter: drop-shadow(0 8px 22px rgba(92, 225, 255, 0.3));
    height: 65px;
}

.qp-brand .qp-brand-text {
    color: #f5f7fb;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dropdown-menu {
    animation: slideDown 0.3s ease;
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    margin-top: 0.5rem;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    color: #4a5568;
    font-weight: 500;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: translateX(5px);
}

.dropdown-item i {
    margin-right: 8px;
    width: 20px;
}

.user-dropdown {
    align-items: center;
    border-radius: 50px;
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.user-dropdown:hover {
    background: rgba(102, 126, 234, 0.1);
}

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

/* 4. UI Elements (Cards, Badges, etc.) */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-header {
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.qp-pill {
    align-items: center;
    background: linear-gradient(120deg, rgba(92, 225, 255, 0.2), rgba(244, 201, 93, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: #000;
    display: inline-flex;
    font-weight: 600;
    gap: 8px;
    padding: 10px 16px;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.qp-pill:hover {
    transform: translateY(-1px);
}

.badge {
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
}

.alert {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.25rem;
}

/* 5. Buttons */
.btn {
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
}

.qp-outline-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 50%, #0ea5e9 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #f5f7fb;
    padding: 10px 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.qp-outline-btn:hover {
    background: #f5f7fb !important;
    color: #0b1021;
}

.btn-premium {
    background: linear-gradient(135deg, #38decb 0%, #2ac5b2 100%);
    border: none;
    color: #020617;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.btn-premium:hover {
    filter: brightness(1.1);
    box-shadow: 0 10px 20px -5px rgba(56, 222, 203, 0.4);
    transform: translateY(-2px);
}

/* 6. Form Controls */
.form-control,
.form-select {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.625rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
    outline: none;
}

.input-glass {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    transition: all 0.3s ease;
}

.input-glass:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--qp-primary-light) !important;
    box-shadow: 0 0 0 4px rgba(56, 222, 203, 0.15) !important;
}

/* 7. Unique Components & Animations */
.login-glass-card {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-glass-card:hover {
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

.blur-bg-element {
    filter: blur(120px);
    pointer-events: none;
    z-index: -1;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 8. Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* 9. Media Queries */
@media (max-width: 991.98px) {
    .navbar-nav {
        padding: 1rem 0;
    }

    .nav-link {
        margin: 0.25rem 0;
    }

    .user-dropdown {
        justify-content: flex-start;
    }
}

.qp-page-hero {
    position: relative;
    border-radius: 26px;
    overflow: hidden;
    padding: 42px 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 50%, #0ea5e9 100%);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.qp-page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(244, 201, 93, 0.28), transparent 35%),
        radial-gradient(circle at 20% 10%, rgba(92, 225, 255, 0.35), transparent 30%);
    opacity: 0.6;
    pointer-events: none;
}

.qp-page-hero h1 {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #000;
}

.qp-page-hero .qp-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #e8edf5;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.12);
    letter-spacing: 0.04em;
}

.qp-page-hero .qp-meta {
    color: rgba(255, 255, 255, 0.72);
}

.qp-hero-image {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    background: rgba(0, 0, 0, 0.2);
}

.qp-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qp-article {
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.qp-article .qp-article-body {
    color: #000;
    line-height: 1.75;
    font-size: 1.02rem;
}

.qp-article-body h2,
.qp-article-body h3,
.qp-article-body h4 {
    margin-top: 1.6rem;
    font-weight: 700;
    color: #000;
}

.qp-article-body p {
    margin-bottom: 1.1rem;
}

.qp-article-body a {
    color: #7ee2ff;
    text-decoration: underline;
}

.qp-article-body blockquote {
    border-left: 4px solid rgba(92, 225, 255, 0.5);
    padding-left: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.qp-article-body img {
    max-width: 100%;
    border-radius: 16px;
    margin: 12px 0;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.qp-related-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px;
    height: 100%;
    text-decoration: none;
    color: #f8fbff;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.qp-related-card:hover {
    transform: translateY(-4px);
    border-color: rgba(92, 225, 255, 0.4);
}

.qp-footer {
    position: relative;
    overflow: hidden;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;

}

/* Subtle Grid Pattern */
.qp-footer__bg-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    opacity: 0.6;
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

/* Ambient Glow */
.qp-footer__glow {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 400px;
    background: radial-gradient(ellipse at center, rgba(56, 222, 203, 0.08), transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

/* Brand Box */
.qp-footer__brand-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--qp-border-color);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
}

.qp-footer__logo-wrapper {
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qp-footer__logo {
    height: 28px;
    width: auto;
}

/* Badges */
.qp-footer__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    font-size: 0.85rem;
    color: #e2e8f0;
    font-weight: 500;
}

/* Menu Items */
.qp-footer__category-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    display: inline-block;
    margin-bottom: 8px;
    text-decoration: none;
    position: relative;
}

.qp-footer__link {
    color: var(--qp-text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.qp-footer__link:hover {
    color: var(--qp-primary-light);
    transform: translateX(2px);
}

.qp-footer__link::before {
    content: '';
    display: block;
    width: 0;
    height: 1px;
    background: var(--qp-primary-light);
    margin-right: 0;
    transition: width 0.2s ease, margin-right 0.2s ease;
}

.qp-footer__link:hover::before {
    width: 8px;
    margin-right: 8px;
}

/* Empty State */
.qp-footer__empty-state {
    text-align: center;
    padding: 40px;
    border: 2px dashed var(--qp-border-color);
    border-radius: 12px;
    color: var(--qp-text-muted);
}

/* Footer Bottom */
.qp-footer__bottom {
    border-top: 1px solid var(--qp-border-color);
}

.qp-footer__legal-link {
    color: var(--qp-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.15s;
}

.qp-footer__legal-link:hover {
    color: #fff;
    text-decoration: underline;
}

.qp-hero {
    position: relative;
    border-radius: 26px;
    padding: 36px;
    overflow: hidden;
    background: linear-gradient(125deg, rgba(92, 225, 255, 0.16), rgba(244, 201, 93, 0.12));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
}

.qp-hero::after {
    content: "";
    position: absolute;
    inset: 0;

}

.qp-hero h1 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: fff;
}

.qp-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e8edf5;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.qp-page-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 22px;
    color: #000;
    height: 100%;
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.qp-page-card:hover {
    transform: translateY(-6px);
    border-color: rgba(92, 225, 255, 0.5);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.qp-page-card small {
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.03em;
}

.qp-page-card h3 {
    font-weight: 700;
    margin: 12px 0 6px 0;
    color: #000;
}

.qp-page-card p {
    color: #fff;
    margin-bottom: 14px;
    line-height: 1.5;
}

.qp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(92, 225, 255, 0.12);
    color: #c4f4ff;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(92, 225, 255, 0.3);
}

.qp-gradient-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 50%, #0ea5e9 100%);
    margin: 18px 0;
}