/* ===== Growin CRM Stylesheet Entry Point ===== */
/* Responsive Breakpoints:
   - Desktop: 1200px and up (default.css - base styles)
   - Tablet: 768px - 1199px (tablet.css)
   - Mobile: up to 767px (mobile.css)
*/

/* Fonts loaded via App.razor <link> tags with preconnect for better performance:
   - Inter: Body text, UI elements
   - DM Sans: Section headings
   - Playfair Display: Accent/italic text
*/

@import url('variables.css');
@import url('default.css');
@import url('tablet.css') screen and (min-width: 768px) and (max-width: 1199px);
@import url('mobile.css') screen and (max-width: 767px);

/* ===== Blazor reconnect modal =====
   #components-reconnect-modal is toggled by the framework via CSS classes.
   We render it as a bottom-right toast instead of the default centered modal. */
#components-reconnect-modal {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    animation: blazor-reconnect-slidein 0.3s ease-out;
}
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: block;
}
#components-reconnect-modal.components-reconnect-hide {
    display: none;
}
#components-reconnect-modal .reconnect-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
#components-reconnect-modal.components-reconnect-failed .reconnect-toast,
#components-reconnect-modal.components-reconnect-rejected .reconnect-toast {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
#components-reconnect-modal.components-reconnect-failed .reconnect-message::after,
#components-reconnect-modal.components-reconnect-rejected .reconnect-message::after {
    content: ' ' attr(data-reload-text);
}
#components-reconnect-modal .reconnect-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: blazor-reconnect-spin 1s linear infinite;
}
#components-reconnect-modal.components-reconnect-failed .reconnect-spinner,
#components-reconnect-modal.components-reconnect-rejected .reconnect-spinner {
    display: none;
}
@keyframes blazor-reconnect-spin {
    to { transform: rotate(360deg); }
}
@keyframes blazor-reconnect-slidein {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ── TaskTemplateForm mobile ── */
@media (max-width: 575.98px) {
    .task-template-form.card {
        border-left: none;
        border-right: none;
        border-radius: 0;
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }

    .task-template-form .card-header {
        padding: 0.5rem 0.875rem;
    }

    .task-template-form .card-header h6 {
        font-size: 0.875rem;
    }

    .task-template-form .card-body {
        padding: 0.75rem 0.875rem;
    }

    .task-template-form .mb-3 {
        margin-bottom: 0.5rem !important;
    }

    .task-template-form .form-label {
        margin-bottom: 0.2rem;
        font-size: 0.85rem;
    }

    .task-template-form .form-control,
    .task-template-form .form-select {
        padding: 0.35rem 0.6rem;
        font-size: 0.875rem;
    }

    .task-template-form textarea.form-control {
        min-height: 60px;
    }

    .task-template-form small.text-muted {
        font-size: 0.75rem;
    }

    /* Priority + Due date: side by side */
    .task-template-form .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* Title full-width already, keep it */
    .task-template-form .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ── MetaIntegrationConnect mobile ── */
@media (max-width: 575.98px) {
    /* Page-level heading */
    .meta-connect-page h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    /* Card: edge-to-edge */
    .meta-connect-page .card {
        border-left: none;
        border-right: none;
        border-radius: 0;
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }

    .meta-connect-page .card-header {
        padding: 0.5rem 0.875rem;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.375rem;
    }

    .meta-connect-page .card-header h5 {
        font-size: 0.95rem;
        margin-bottom: 0;
    }

    .meta-connect-page .card-body {
        padding: 0.75rem 0.875rem;
    }

    /* List items: tighter, badge on its own line if needed */
    .meta-connect-page .list-group-item {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }

    .meta-connect-page .list-group-item strong {
        font-size: 0.9rem;
    }

    /* Checkbox area: keep aligned */
    .meta-connect-page .list-group-item .form-check-input {
        margin-top: 0.2rem;
        flex-shrink: 0;
    }

    /* Badge: shrink */
    .meta-connect-page .badge {
        font-size: 0.7rem;
        white-space: nowrap;
        flex-shrink: 0;
        align-self: flex-start;
        margin-top: 0.15rem;
    }
}

.legal-toc {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.legal-toc .nav-link {
    color: var(--text-secondary, #6c757d);
    text-decoration: none;
}

.legal-toc .nav-link:hover {
    color: var(--bs-primary);
}

.legal-section-anchor {
    scroll-margin-top: 6rem;
}

.legal-content a,
.sub-processors-page a,
.form-check-label a {
    text-decoration: underline;
}

@media print {
    @page {
        size: A4;
        margin: 20mm 15mm;
    }

    body {
        font-size: 11pt;
        color: #000;
        background: #fff;
    }

    /* Hide everything that shouldn't appear on print */
    nav.navbar,
    footer,
    .legal-toc,
    .print-hide,
    aside {
        display: none !important;
    }

    /* Make the content column full width */
    .col-lg-9 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .row {
        display: block !important;
    }

    a[href]::after {
        content: none !important;
    }

    h1, h2 {
        page-break-after: avoid;
    }

    section {
        page-break-inside: avoid;
    }
}
