/* Papaya Consent Checker - Custom Styles */

:root {
    --primary-gradient: linear-gradient(180deg, #764ba2 0%, #667eea 100%);
    --success-gradient: linear-gradient(135deg, #28a745, #20c997);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
}

body.app-body {
    background: var(--primary-gradient);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #ffffff;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 2000;
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    background: #ffffff;
    color: #111827;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.2);
}

.skip-link:focus {
    top: 1rem;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: 320px;
    flex: 0 0 320px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    padding: 1rem 1.1rem;
    animation: slideInSidebar 0.45s ease-out;
}

.app-sidebar-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 2rem);
    padding: 1.2rem 1rem 1rem;
    border-radius: 1.5rem;
    background: linear-gradient(180deg, rgba(31, 41, 95, 0.42), rgba(88, 65, 182, 0.26));
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(16px);
    box-shadow: 0 24px 60px rgba(16, 24, 40, 0.28);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-decoration: none;
}

.app-brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    background: #ffffff;
    padding: 0.45rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.25);
}

.app-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.app-brand-subtitle {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.74);
}

.app-nav {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.app-nav-link,
.app-sidebar-utility {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.85rem 0.95rem;
    border: 0;
    border-radius: 1rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-weight: 600;
    text-align: left;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.app-nav-link:hover,
.app-nav-link:focus,
.app-sidebar-utility:hover,
.app-sidebar-utility:focus {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: translateX(4px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.app-brand:focus-visible,
.app-nav-link:focus-visible,
.app-sidebar-utility:focus-visible,
.app-sidebar-legal a:focus-visible,
.app-mobile-nav-toggle:focus-visible {
    outline: 3px solid #fef08a;
    outline-offset: 3px;
}

.app-nav-link.is-active,
.app-sidebar-utility.is-active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 12px 28px rgba(15, 23, 42, 0.18);
}

.app-nav-link.is-disabled,
.app-sidebar-utility.is-disabled {
    opacity: 0.42;
    cursor: not-allowed;
    box-shadow: none;
    pointer-events: none;
}

.app-nav-link.is-disabled:hover,
.app-nav-link.is-disabled:focus,
.app-sidebar-utility.is-disabled:hover,
.app-sidebar-utility.is-disabled:focus {
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    transform: none;
    box-shadow: none;
}

.app-nav-icon {
    font-size: 1.05rem;
    width: 1.25rem;
    text-align: center;
    flex: 0 0 1.25rem;
}

.app-nav-label {
    min-width: 0;
}

.app-sidebar-bottom {
    margin-top: auto;
    padding-top: 1.2rem;
}

.app-sidebar-auth {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.app-sidebar-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 1.25rem;
    font-size: 0.88rem;
}

.app-sidebar-legal a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.app-sidebar-legal a:hover,
.app-sidebar-legal a:focus {
    color: #ffffff;
}

.app-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.5rem 1.5rem 2rem 0;
}

.app-mobile-nav-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1045;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
}

.app-mobile-nav-toggle:hover,
.app-mobile-nav-toggle:focus {
    background: rgba(15, 23, 42, 0.58);
    color: #ffffff;
}

.app-mobile-nav-toggle i {
    font-size: 1.35rem;
}

.app-sidebar-offcanvas {
    width: min(320px, 88vw) !important;
    background: transparent;
    border-right: 0;
}

.app-sidebar-offcanvas .offcanvas-body {
    padding: 1rem 0.9rem 1rem 1rem !important;
}

.app-sidebar-offcanvas .app-sidebar-panel {
    min-height: calc(100vh - 2rem);
}

@keyframes slideInSidebar {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar,
    .app-nav-link,
    .app-sidebar-utility,
    .papaya-btn,
    .fade-in,
    .pulse {
        animation: none !important;
        transition: none !important;
    }
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.papaya-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.papaya-btn {
    background: var(--primary-gradient);
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.papaya-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    color: white;
}

.papaya-btn-success {
    background: var(--success-gradient);
}

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

.url-placeholder-input::placeholder {
    color: #9ca3af;
    opacity: 1;
}

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

.app-page {
    padding: 1.25rem 0 2rem;
}

.app-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.app-page-header-copy {
    max-width: 760px;
}

.app-page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    margin-bottom: 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-page-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.05;
}

.app-page-title-compact {
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
}

.app-page-subtitle {
    margin: 0.75rem 0 0;
    max-width: 56rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    line-height: 1.65;
}

.app-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-start;
}

.app-page-actions .btn {
    border-radius: 999px;
    padding-inline: 1rem;
    font-weight: 600;
}

.app-surface {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1.5rem;
    box-shadow: 0 22px 55px rgba(10, 15, 35, 0.16);
    backdrop-filter: blur(16px);
    color: #0f172a;
}

.app-surface-muted {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 247, 251, 0.95));
}

.app-surface-body {
    padding: 1.4rem;
}

.app-section-title {
    margin: 0 0 1rem;
    color: #111827;
    font-size: 1.15rem;
    font-weight: 700;
}

.app-section-subtitle {
    color: #64748b;
}

.app-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.9rem;
}

.app-detail-item {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid #e2e8f0;
}

.app-detail-label {
    display: block;
    margin-bottom: 0.35rem;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-detail-value {
    color: #0f172a;
    font-weight: 600;
    word-break: break-word;
}

.live-layout {
    align-items: stretch;
}

.live-browser {
    overflow: hidden;
}

.live-browser-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}

.live-browser-meta {
    min-width: 0;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.live-browser-controls {
    display: flex;
    gap: 0.45rem;
}

.live-browser-dot {
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 999px;
}

.live-browser-dot.is-red {
    background: #ff5f56;
}

.live-browser-dot.is-yellow {
    background: #ffbd2e;
}

.live-browser-dot.is-green {
    background: #27ca3f;
}

.live-browser-frame-wrap {
    position: relative;
    background: #ffffff;
    aspect-ratio: 16 / 9;
    width: 100%;
}

.live-browser-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

.live-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 220px;
    padding: 2rem;
}

.live-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.live-status-badge.status-starting {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.live-status-badge.status-downloading_trackers,
.live-status-badge.status-initializing_browser {
    background: #ecfeff;
    border-color: #a5f3fc;
    color: #155e75;
}

.live-status-badge.status-navigating {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.live-status-badge.status-analyzing {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

.live-status-badge.status-completed {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.live-status-badge.status-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.live-progress-copy {
    color: #475569;
    line-height: 1.6;
}

.live-results-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.9rem 1.15rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.live-results-cta:hover,
.live-results-cta:focus {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.22);
}

.results-summary-card {
    padding: 1.2rem 1.35rem;
    border-radius: 1.6rem;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(22, 101, 52, 0.94), rgba(5, 150, 105, 0.92));
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.2);
}

.results-summary-card.is-error {
    background: linear-gradient(135deg, rgba(153, 27, 27, 0.94), rgba(234, 88, 12, 0.92));
}

.results-summary-card p,
.results-summary-card strong {
    color: inherit;
}

.results-summary-icon {
    font-size: clamp(2rem, 4vw, 2.8rem);
    opacity: 0.18;
}

.results-section {
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.results-section h3,
.results-section h4,
.results-section h5,
.results-section h6 {
    color: #0f172a;
}

.results-metric-card {
    height: 100%;
    padding: 1.4rem;
    border-radius: 1.2rem;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
    text-align: center;
}

.results-metric-card.is-post {
    border-top: 4px solid #f97316;
}

.results-metric-number {
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 800;
    color: #111827;
}

.results-metric-label {
    margin-top: 0.35rem;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tracker-card {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #dc2626;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.company-badge {
    display: inline-block;
    margin: 0.2rem 0.35rem 0.2rem 0;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
}

.raw-data {
    background: #f8fafc;
    border-radius: 1rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: #0f172a;
}

.agent-steps-table {
    white-space: nowrap;
}

.agent-steps-table th,
.agent-steps-table td {
    vertical-align: top;
    white-space: nowrap;
}

.agent-steps-table code,
.agent-steps-table .step-message {
    display: inline-block;
    white-space: nowrap;
}

.comparison-column {
    display: flex;
}

.comparison-panel {
    width: 100%;
    padding: 1.5rem;
    border-radius: 1.2rem;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.98));
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.comparison-panel.pre-panel {
    border-top: 4px solid #94a3b8;
}

.comparison-panel.post-panel {
    border-top: 4px solid #f97316;
}

.comparison-note {
    padding: 0.9rem 1rem;
    border-radius: 0.9rem;
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.22);
    color: #9a3412;
}

#compliance-summary-container {
    background: linear-gradient(180deg, #fbfcff 0%, #f4f7fb 100%) !important;
    border: 1px solid #d7deea !important;
    border-radius: 18px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    color: #1f2937;
}

#compliance-summary-container h3 {
    color: #1f2a44;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

#compliance-summary-container h3:first-child {
    margin-top: 0;
}

#compliance-summary-container p,
#compliance-summary-container li {
    color: #334155;
    line-height: 1.6;
}

#compliance-summary-container table {
    width: 100%;
    margin: 0.75rem 0 1.5rem;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
}

#compliance-summary-container th {
    background: linear-gradient(180deg, #eef4ff 0%, #e2ebfb 100%);
    color: #243b63;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.9rem 0.85rem;
    border-bottom: 1px solid #cbd5e1;
    text-align: left;
}

#compliance-summary-container td {
    padding: 0.9rem 0.85rem;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

#compliance-summary-container td:last-child,
#compliance-summary-container th:last-child {
    border-right: 0;
}

#compliance-summary-container tr:last-child td {
    border-bottom: 0;
}

#compliance-summary-container tr:nth-child(even) td {
    background: #f8fbff;
}

#compliance-summary-container a {
    color: #0f5cc0;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(15, 92, 192, 0.35);
    transition: color 0.2s ease, border-color 0.2s ease;
}

#compliance-summary-container a:hover {
    color: #0b4a9a;
    border-bottom-color: rgba(11, 74, 154, 0.7);
}

#compliance-summary-container ul {
    padding-left: 1.25rem;
}

#compliance-summary-container em {
    display: block;
    margin-top: 1.25rem;
    color: #52607a;
}

@media (max-width: 991.98px) {
    .app-main {
        padding: 5rem 1rem 1.5rem;
    }

    .app-page {
        padding-top: 0;
    }

}

@media (max-width: 767.98px) {
    .app-page-actions {
        width: 100%;
    }

    .app-page-actions .btn {
        flex: 1 1 auto;
    }

    .live-browser-header {
        flex-wrap: wrap;
        justify-content: center;
    }

    .live-browser-meta {
        order: 3;
        width: 100%;
    }

    .results-section,
    .app-surface-body,
    .results-summary-card {
        padding: 1.1rem;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .glass-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .papaya-btn {
        width: 100%;
        margin-bottom: 1rem;
    }

    .app-main {
        width: 100%;
        padding: 4.75rem 1rem 1.5rem;
    }
}

@media (max-width: 991.98px) {
    .app-main {
        padding: 4.75rem 1rem 1.5rem;
    }
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* LinkedIn branded button */
.btn-linkedin {
    background-color: #0A66C2;
    color: #fff;
    border-color: #0A66C2;
}
.btn-linkedin:hover,
.btn-linkedin:focus {
    background-color: #084C98;
    border-color: #084C98;
    color: #fff;
}
.btn-linkedin svg {
    width: 18px;
    height: 18px;
}
.btn-linkedin:focus {
    box-shadow: 0 0 0 0.2rem rgba(10, 102, 194, 0.25);
}

/* Login page logo sizing */
.papaya-logo {
    height: 40px;
    width: auto;
}

.api-docs-shell {
    background: rgba(255, 255, 255, 0.97);
}

.api-docs-content {
    color: #1f2937;
}

.api-docs-content h1,
.api-docs-content h2,
.api-docs-content h3,
.api-docs-content h4 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #111827;
}

.api-docs-content h1:first-child,
.api-docs-content h2:first-child {
    margin-top: 0;
}

.api-docs-content p,
.api-docs-content li {
    line-height: 1.65;
}

.api-docs-content code {
    background: #f3f4f6;
    color: #7c2d12;
    padding: 0.15rem 0.35rem;
    border-radius: 0.35rem;
}

.api-docs-content pre {
    margin: 0;
    padding: 1rem;
    background: #0f172a;
    color: #e5eefc;
    border-radius: 0 0 0.9rem 0.9rem;
    overflow-x: auto;
}

.api-docs-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.api-code-block {
    margin: 1rem 0 1.5rem;
    border-radius: 0.9rem;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.api-code-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.85rem;
    background: #e5e7eb;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.api-code-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #374151;
}

.api-callout-card {
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(243,244,246,0.95));
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.api-callout-label {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: #111827;
}
