@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
    --color-omnis-red: #DA0C1C;
    --color-dark-text: #222222;
    --color-white: #FFFFFF;
    --color-gray-light: #F5F5F5;
    --sidebar-width: 280px;
}

/* Quill Editor Custom Styles */
/* Font Size Dropdown Labels */
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="10px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="10px"]::before {
    content: '10px';
    font-size: 10px !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="12px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="12px"]::before {
    content: '12px';
    font-size: 12px !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="14px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14px"]::before {
    content: '14px';
    font-size: 14px !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="16px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="16px"]::before {
    content: '16px';
    font-size: 16px !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="18px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="18px"]::before {
    content: '18px';
    font-size: 18px !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="20px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="20px"]::before {
    content: '20px';
    font-size: 20px !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="24px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="24px"]::before {
    content: '24px';
    font-size: 24px !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="28px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="28px"]::before {
    content: '28px';
    font-size: 28px !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="32px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="32px"]::before {
    content: '32px';
    font-size: 32px !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="36px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="36px"]::before {
    content: '36px';
    font-size: 36px !important;
}

.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="48px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="48px"]::before {
    content: '48px';
    font-size: 48px !important;
}

/* Apply Font Sizes to Rendered Content (Critical!) */
.ql-size-10px {
    font-size: 10px !important;
}

.ql-size-12px {
    font-size: 12px !important;
}

.ql-size-14px {
    font-size: 14px !important;
}

.ql-size-16px {
    font-size: 16px !important;
}

.ql-size-18px {
    font-size: 18px !important;
}

.ql-size-20px {
    font-size: 20px !important;
}

.ql-size-24px {
    font-size: 24px !important;
}

.ql-size-28px {
    font-size: 28px !important;
}

.ql-size-32px {
    font-size: 32px !important;
}

.ql-size-36px {
    font-size: 36px !important;
}

.ql-size-48px {
    font-size: 48px !important;
}


/* Improved Quill Toolbar */
.ql-toolbar.ql-snow {
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-bottom: 2px solid #dee2e6;
}

.ql-container.ql-snow {
    border-radius: 0 0 8px 8px;
    font-size: 16px;
    border: 1px solid #dee2e6;
    border-top: none;
}

.ql-editor {
    min-height: 200px;
    font-family: 'Inter', sans-serif;
}

.ql-editor.ql-blank::before {
    color: #999;
    font-style: italic;
}


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

html {
    scroll-behavior: auto !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background: white !important;
    color: var(--color-dark-text);
}

/* Page Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-wrapper {
    display: flex;
    flex: 1;
    position: relative;
    width: 100%;
    align-items: flex-start;
    /* CRITICAL: Allows children to have natural height and scroll away */
}

/* Old main-content rule removed */



/* Sidebar */
/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: white;
    border-right: 1px solid #E5E5E5;
    padding: 2rem 2rem 350px 2rem;
    /* Massive bottom padding to allow scrolling content above footer */
    z-index: 1000;
    flex-shrink: 0;
    flex-shrink: 0;
    z-index: 1000;
    flex-shrink: 0;
    flex-shrink: 0;
    /* Scroll disabled as requested */
    overflow-y: hidden;
    scrollbar-width: none;
    /* Firefox: Hide scrollbar */
    -ms-overflow-style: none;
    /* IE/Edge: Hide scrollbar */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Adjust Main Content to sit next to fixed sidebar */
.main-content {
    flex: 1;
    background: white;
    margin-left: var(--sidebar-width);
    /* Push content right */
    min-width: 0;
}




.nav-links {
    list-style: none;
    margin-top: 2rem;
}

.nav-item {
    margin-bottom: 1.5rem;
}

.nav-item:last-child {
    margin-bottom: 0;
}

.nav-links a {
    color: var(--color-dark-text);
    font-size: 1.125rem;
    font-weight: 600;
    transition: opacity 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-links a:hover {
    opacity: 0.7;
    color: var(--color-omnis-red) !important;
}

.nav-links a.active,
.nav-links a.scroll-active {
    font-weight: 700;
    text-decoration: none;
    color: var(--color-omnis-red) !important;
}

/* Main Content - Clean cleanup */
/* .main-content define above */

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Background Image - No Overlay (Now added via pseudo-element), Scrolls with Page */
    background: url('/images/home-bg.jpg') no-repeat center center;
    background-size: cover;
    background-attachment: scroll;
    /* Image moves with the section */
}

/* Dark Overlay for better text visibility */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* 50% opacity black */
    z-index: 1;
}

.hero-content {
    max-width: 1400px;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* Target .display-1 class used in EditableContent */
.hero .display-1 {
    font-size: 4.5rem;
    font-weight: 800;
    color: white !important;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    /* Strong shadow for readability without overlay */
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

/* Ensure red text stays red but legible */
.hero .display-1.text-danger {
    color: var(--color-omnis-red) !important;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

/* Kept for safety if h1 is used elsewhere */
.hero h1 {
    display: none;
}

.hero .tagline {
    font-size: 1.5rem;
    font-weight: 400;
    color: #f8f9fa;
    /* Bright white/gray */
    margin-bottom: 2rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

.hero .description {
    font-size: 1.25rem;
    color: #f1f1f1;
    line-height: 1.75;
    margin-bottom: 3rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

/* Sede Section matched to Hero style REMOVED - Now Static */
/* Styles handled by standard classes in Home.razor */


/* CTA Buttons Container */
.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    /* Prevents buttons from stretching to height of edit wrappers */
    flex-wrap: wrap;
}

.btn-omnis {
    padding: 1rem 2.5rem;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
}

.btn-omnis-primary {
    background: var(--color-omnis-red);
    color: white;
    box-shadow: 0 10px 20px rgba(218, 12, 28, 0.2);
    text-decoration: none !important;
}

.btn-omnis-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(218, 12, 28, 0.3);
    color: white !important;
    background-color: var(--color-omnis-red);
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* Sections */
section {
    padding: 100px 2rem;
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4rem;
}

.section-title span {
    color: var(--color-omnis-red);
}

/* Modern Asymmetric Section */
.section-fullscreen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5rem 1.5rem;
    /* Ensure consistency */
}

.section-modern {
    position: relative;
    background: linear-gradient(135deg, #F1F5F9 0%, #FFFFFF 100%);
    padding: 5rem 1.5rem;
    overflow: hidden;
    /* Already had min-height: 100vh from previous step, but let's defer to section-fullscreen or keep it if we want it by default */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(#DC2626 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.05;
    pointer-events: none;
}

.section-container {
    max-width: 80rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 3fr 9fr;
    gap: 4rem;
    align-items: start;
    position: relative;
    z-index: 1;
}

.section-header h2 {
    font-size: 3rem;
    font-weight: 700;
    color: #DC2626;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.section-header .subtitle {
    font-size: 1.25rem;
    color: #64748B;
    font-weight: 300;
    line-height: 1.5;
}

.services-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.service-card-modern {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(241, 245, 249, 1);
    height: 100%;
}

.service-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.2);
}

.service-icon-modern {
    width: 3rem;
    height: 3rem;
    background: #FEF2F2;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #DC2626;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.service-card-modern h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 0.75rem;
}

.service-card-modern p {
    color: inherit;
    /* Inherit main text color for consistency and contrast */
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

.service-cta {
    color: #DC2626;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    margin-top: 1rem;
    transition: gap 0.2s;
}

.service-cta::after {
    content: '\2192';
    font-size: 1.2em;
    line-height: 1;
}

.service-cta:hover {
    gap: 0.75rem;
    color: #DC2626;
}

@media (max-width: 1024px) {
    .section-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .services-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Courses */
.course-card {
    background: white;
    border-radius: 0.75rem;
    padding: 2.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
    transition: all 0.3s;
    border: 1px solid #f3f3f3;
    margin-bottom: 1.5rem;
}

.course-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.course-info h3 {
    font-size: 1.75rem;
    color: var(--color-omnis-red);
    margin-bottom: 1rem;
    font-weight: 700;
}

.course-details {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.course-detail-item {
    color: #666;
    font-size: 0.95rem;
}

.course-detail-item strong {
    color: var(--color-dark-text);
}

/* Chi Siamo Pillars */
.benefit {
    margin-bottom: 3rem;
}

.benefit h3 {
    font-size: 2rem;
    color: var(--color-dark-text);
    font-weight: 700;
    margin-bottom: 1rem;
}

.benefit p {
    font-size: 1.15rem;
    color: #555;
    line-height: 1.8;
}

/* Footer Details */
.footer-omnis {
    background: #111;
    color: #888;
    padding: 5rem 2rem 1.5rem;
    width: 100%;
    /* Positioned naturally in flex column */
}

.footer-omnis h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.footer-omnis a {
    color: #888;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-omnis a:hover {
    color: var(--color-omnis-red);
}

/* Search Input */
.search-input-omnis {
    width: 100%;
    max-width: 600px;
    padding: 1rem 1.5rem;
    border: 2px solid #eee;
    border-radius: 8px;
    margin: 0 auto 3rem;
    display: block;
    font-family: inherit;
    font-size: 1rem;
}

/* Hamburger Menu Button (Mobile Only) */
.hamburger-menu {
    display: none;
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 2000;
    background: var(--color-omnis-red);
    border: none;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(218, 12, 28, 0.3);
    transition: transform 0.2s;
}

.hamburger-menu:active {
    transform: scale(0.95);
}

.hamburger-menu span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

/* Sidebar Overlay (Mobile Only) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Responsive */
@media (max-width: 1024px) {

    /* Show hamburger menu on mobile */
    .hamburger-menu {
        display: flex;
    }

    /* Show overlay on mobile */
    .sidebar-overlay {
        display: block;
    }

    /* Hide sidebar by default on mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1001;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    }

    /* Show sidebar when open */
    .sidebar.open {
        transform: translateX(0);
    }

    /* Main content takes full width on mobile */
    .main-content {
        margin-left: 0;
    }

    /* Hero adjustments */
    .hero .display-1 {
        font-size: 2.5rem;
    }

    .hero .tagline {
        font-size: 1.1rem;
        letter-spacing: 0.15em;
    }

    .hero .description {
        font-size: 1rem;
    }

    /* Section titles */
    .section-title {
        font-size: 2rem;
    }

    /* Services grid to single column */
    .section-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .services-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    /* Further mobile optimizations */
    section {
        padding: 60px 1.5rem;
    }

    .hero .display-1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    /* Course cards stack */
    .course-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.5rem;
    }

    .course-details {
        justify-content: center;
    }

    /* Footer stack vertically */
    .footer-omnis .row {
        text-align: center;
    }

    .footer-omnis .col-md-4 {
        margin-bottom: 2rem;
    }

    /* Buttons full width on small mobile */
    .btn-omnis {
        padding: 0.875rem 2rem;
        font-size: 0.95rem;
    }
}

/* Hide Blazor Dev Tools */
#blazor-error-ui,
.reload-indicator,
[data-blazor-reload] {
    display: none !important;
}

/* Remove focus outline on links and buttons */
a:focus,
a:focus-visible,
button:focus,
button:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Vertical variant for Home Page Grid */
.course-card.vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    align-items: stretch;
    grid-template-columns: none;
    /* Reset grid if inherited */
}

.course-card.vertical .course-info {
    padding: 0 !important;
    text-align: center;
}

.course-card.vertical .course-details {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.course-card.vertical .p-3.border-top {
    margin-top: auto;
    background: none !important;
    border: none !important;

    padding: 0 !important;
}

/* Global Editor Modal Styling - Force White Theme */
.global-editor-modal {
    background-color: #ffffff !important;
    color: #222222 !important;
    border: 1px solid #dee2e6;
}

/* Force inputs in editor to be standard */
.global-editor-modal input,
.global-editor-modal textarea,
.global-editor-modal select {
    background-color: #ffffff !important;
    color: #222222 !important;
    border: 1px solid #ced4da;
    box-shadow: none !important;
}

.global-editor-modal input:focus,
.global-editor-modal textarea:focus {
    background-color: #ffffff !important;
    color: #222222 !important;
    border-color: var(--color-omnis-red) !important;
    box-shadow: 0 0 0 0.25rem rgba(218, 12, 28, 0.25) !important;
}

/* Quill Editor Specifics */
.ql-toolbar.ql-snow {
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
}

.ql-container.ql-snow {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

.ql-editor {
    background-color: #ffffff !important;
    color: #222222 !important;
}

/* Ensure placehoders are visible */
.ql-editor.ql-blank::before {
    color: #999 !important;
}

/* Footer Omnis - Full Width */
.footer-omnis {
    background-color: #111;
    color: white;
    padding: 4rem 0 2rem 0;
    margin-top: auto;
    width: 100%;
    position: relative;
    z-index: 2000;
    /* Higher than sidebar (1000) to cover it */
}

/* === ADMIN LAYOUT OVERRIDES === */
.layout-admin .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    bottom: 0 !important;
    height: 100vh !important;
    /* Scroll disabled as requested */
    overflow-y: hidden !important;
    /* Scrollbar hidden as requested */
    scrollbar-width: none;
    z-index: 1000 !important;
    transform: none !important;
    transition: none !important;
    padding-bottom: 2rem !important;
    /* Normal padding, no huge gap needed if footer is hidden */
}

/* Scrollbar hidden for Admin Sidebar */
.layout-admin .sidebar::-webkit-scrollbar,
.user-admin .sidebar::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Ensure sidebar enables scrolling if content overflows for Admin User even on public pages */
.user-admin .sidebar {
    /* Scroll disabled as requested */
    overflow-y: hidden !important;
    /* Allow scroll */
    max-height: 100vh !important;
    /* Constrain height so scroll happens internally */
}

/* Ensure Logo and Nav items are always visible in Admin */
.layout-admin .sidebar .logo,
.layout-admin .sidebar .nav-links {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    display: block !important;
    height: auto !important;
    overflow: visible !important;
}

/* Disable the scroll spy/compact logic visual effects if they try to trigger */
.layout-admin.sidebar-compact .sidebar {
    width: 280px !important;
    /* Force full width even if JS adds compact class */
}

.layout-admin.sidebar-compact .sidebar .logo {
    display: block !important;
}

/* Adjust main content to respect fixed sidebar */
@media (min-width: 992px) {
    .layout-admin .main-content {
        margin-left: 280px !important;
        /* Matches sidebar width */
        width: calc(100% - 280px) !important;
    }
}

/* CRITICAL FIX: Allow mobile behavior even in admin layout */
@media (max-width: 1024px) {
    .layout-admin .sidebar {
        /* Re-enable mobile behavior */
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease-in-out !important;
    }

    .layout-admin .sidebar.open {
        transform: translateX(0) !important;
    }
}