/* ========================================
   M3 TOOL PAGE CONTENT SECTIONS
   Redesigned breadcrumbs, how-to, use cases, FAQ
   Inspired by pdf-editing-tools.html theme
   ======================================== */

/* ========================================
   BREADCRUMBS - Floating Pill Style
   ======================================== */
.m3-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 9999px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.8);
    margin: 1.5rem 0;
    list-style: none;
}

.m3-breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.m3-breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    color: var(--m3-primary, #4f46e5);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.m3-breadcrumb-link:hover {
    background: var(--m3-primary-container, #e0e7ff);
    transform: scale(1.05);
}

.m3-breadcrumb-link svg {
    width: 16px;
    height: 16px;
}

.m3-breadcrumb-separator {
    color: #94a3b8;
    font-size: 0.75rem;
}

.m3-breadcrumb-current {
    padding: 0.375rem 0.75rem;
    background: var(--m3-primary, #4f46e5);
    color: white;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ========================================
   CONTENT ARTICLE CONTAINER
   ======================================== */
.m3-content-article {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ========================================
   ABOUT SECTION - Glassmorphic Hero Card
   ======================================== */
.m3-about-section {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.m3-about-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.m3-about-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.m3-about-icon {
    width: 64px;
    height: 64px;
    min-width: 64px;
    background: linear-gradient(135deg, var(--m3-primary, #4f46e5), #6366f1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}

.m3-about-icon svg {
    width: 32px;
    height: 32px;
}

.m3-about-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.m3-about-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

.m3-about-content p {
    color: #475569;
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.m3-about-content p:last-child {
    margin-bottom: 0;
}

/* Feature badges */
.m3-feature-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.m3-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.m3-feature-badge svg {
    width: 16px;
    height: 16px;
    color: var(--m3-primary, #4f46e5);
}

/* ========================================
   HOW-TO SECTION - Interactive Timeline
   ======================================== */
.m3-howto-section {
    margin-bottom: 3rem;
}

.m3-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.m3-section-icon {
    width: 48px;
    height: 48px;
    background: var(--m3-primary-container, #e0e7ff);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--m3-primary, #4f46e5);
}

.m3-section-icon svg {
    width: 24px;
    height: 24px;
}

.m3-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

/* Step indicators */
.m3-step-indicators {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 80px;
    z-index: 10;
}

.m3-step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    border: 2px solid transparent;
}

.m3-step-indicator.active {
    background: var(--m3-primary, #4f46e5);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

.m3-step-indicator.completed {
    background: var(--m3-success, #10b981);
    color: white;
}

.m3-step-connector {
    width: 40px;
    height: 3px;
    background: #e2e8f0;
    margin: 0 0.25rem;
    border-radius: 2px;
    transition: background 0.3s;
}

.m3-step-connector.completed {
    background: var(--m3-success, #10b981);
}

/* Step cards (accordion) */
.m3-step-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.m3-step-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.m3-step-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.m3-step-card[open] {
    border-color: var(--m3-primary, #4f46e5);
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.15);
}

.m3-step-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    list-style: none;
    transition: background 0.2s;
}

.m3-step-summary::-webkit-details-marker {
    display: none;
}

.m3-step-summary:hover {
    background: #f8fafc;
}

.m3-step-number {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--m3-primary-container, #e0e7ff);
    color: var(--m3-primary, #4f46e5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.m3-step-card[open] .m3-step-number {
    background: var(--m3-primary, #4f46e5);
    color: white;
}

.m3-step-title {
    flex: 1;
    font-weight: 600;
    font-size: 1.0625rem;
    color: #1e293b;
}

.m3-step-chevron {
    width: 24px;
    height: 24px;
    color: #94a3b8;
    transition: transform 0.3s;
}

.m3-step-card[open] .m3-step-chevron {
    transform: rotate(180deg);
    color: var(--m3-primary, #4f46e5);
}

.m3-step-content {
    padding: 0 1.5rem 1.5rem 4.5rem;
    color: #475569;
    line-height: 1.8;
}

.m3-step-content ul,
.m3-step-content ol {
    margin: 1rem 0;
    padding-left: 1.25rem;
}

.m3-step-content li {
    margin-bottom: 0.5rem;
}

.m3-step-note {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-left: 3px solid var(--m3-primary, #4f46e5);
    border-radius: 0 8px 8px 0;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* ========================================
   USE CASES SECTION - Visual Grid
   ======================================== */
.m3-usecases-section {
    margin-bottom: 3rem;
}

.m3-usecases-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.m3-usecase-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.m3-usecase-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--m3-primary, #4f46e5), #6366f1);
    opacity: 0;
    transition: opacity 0.3s;
}

.m3-usecase-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.12);
    border-color: var(--m3-primary, #4f46e5);
}

.m3-usecase-card:hover::before {
    opacity: 1;
}

.m3-usecase-icon {
    width: 44px;
    height: 44px;
    background: var(--m3-primary-container, #e0e7ff);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--m3-primary, #4f46e5);
    transition: all 0.3s;
}

.m3-usecase-card:hover .m3-usecase-icon {
    background: var(--m3-primary, #4f46e5);
    color: white;
    transform: rotate(-5deg) scale(1.1);
}

.m3-usecase-icon svg {
    width: 22px;
    height: 22px;
}

.m3-usecase-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.m3-usecase-desc {
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* ========================================
   FAQ SECTION - Animated Accordion
   ======================================== */
.m3-faq-section-redesign {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.m3-faq-header {
    text-align: center;
    margin-bottom: 2rem;
}

.m3-faq-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--m3-primary, #4f46e5), #6366f1);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.m3-faq-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.m3-faq-list {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.m3-faq-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s;
}

.m3-faq-card[open] {
    border-color: var(--m3-primary, #4f46e5);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.12);
}

.m3-faq-question {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: #1e293b;
    transition: background 0.2s;
}

.m3-faq-question::-webkit-details-marker {
    display: none;
}

.m3-faq-question:hover {
    background: #f8fafc;
}

.m3-faq-question svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    color: var(--m3-primary, #4f46e5);
    transition: transform 0.3s;
}

.m3-faq-card[open] .m3-faq-question svg {
    transform: rotate(180deg);
}

.m3-faq-text {
    flex: 1;
}

.m3-faq-answer {
    padding: 0 1.25rem 1.25rem 3.5rem;
    color: #64748b;
    line-height: 1.7;
    animation: faqSlideDown 0.3s ease-out;
}

@keyframes faqSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .m3-breadcrumb {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .m3-about-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .m3-about-icon {
        margin-bottom: 0.5rem;
    }

    .m3-feature-badges {
        justify-content: center;
    }

    .m3-step-indicators {
        padding: 0.75rem;
        gap: 0;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .m3-step-indicator {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .m3-step-connector {
        width: 24px;
    }

    .m3-step-content {
        padding-left: 1.5rem;
    }

    .m3-usecases-grid {
        grid-template-columns: 1fr;
    }

    .m3-faq-section-redesign {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }

    .m3-faq-answer {
        padding-left: 1.25rem;
    }
}

@media (max-width: 480px) {
    .m3-about-section {
        padding: 1.5rem;
    }

    .m3-section-header {
        flex-direction: column;
        text-align: center;
    }

    .m3-step-summary {
        padding: 1rem;
    }

    .m3-usecase-card {
        padding: 1.25rem;
    }
}

/* ========================================
   PROCESSING STAGE - M3 Design
   ======================================== */
.m3-processing-card {
    background: white;
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    max-width: 500px;
    margin: 0 auto;
}

.m3-processing-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, var(--m3-primary, #4f46e5), #6366f1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: processingPulse 2s ease-in-out infinite;
}

.m3-processing-icon svg {
    width: 48px;
    height: 48px;
    color: white;
    animation: processingSpin 3s linear infinite;
}

@keyframes processingPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(79, 70, 229, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 48px rgba(79, 70, 229, 0.5);
    }
}

@keyframes processingSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.m3-processing-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.m3-processing-status {
    color: #64748b;
    font-size: 1rem;
    margin: 0 0 2rem 0;
}

.m3-progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

.m3-progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.m3-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--m3-primary, #4f46e5), #6366f1);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.m3-progress-text {
    font-weight: 600;
    color: var(--m3-primary, #4f46e5);
    min-width: 40px;
    font-size: 0.875rem;
}

.m3-processing-note {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 9999px;
    color: #166534;
    font-size: 0.875rem;
    font-weight: 500;
}

.m3-processing-note svg {
    color: #22c55e;
}

/* ========================================
   DOWNLOAD STAGE - M3 Design
   ======================================== */
.m3-download-card {
    background: white;
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    max-width: 500px;
    margin: 0 auto;
}

.m3-download-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.3);
}

.m3-download-icon svg {
    width: 48px;
    height: 48px;
    color: white;
}

@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.m3-download-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.m3-download-subtitle {
    color: #64748b;
    font-size: 1rem;
    margin: 0 0 2rem 0;
}

.m3-download-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.m3-stat-card {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: 16px;
    padding: 1.5rem 2.5rem;
    min-width: 140px;
}

.m3-stat-value {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--m3-primary, #4f46e5), #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.m3-stat-label {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.m3-download-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.m3-btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--m3-primary, #4f46e5), #6366f1);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
}

.m3-btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}

.m3-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 2rem;
    background: white;
    color: var(--m3-primary, #4f46e5);
    border: 2px solid var(--m3-primary, #4f46e5);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.m3-btn-secondary:hover {
    background: var(--m3-primary-container, #e0e7ff);
    transform: translateY(-2px);
}

/* Mobile responsive for processing/download */
@media (max-width: 480px) {

    .m3-processing-card,
    .m3-download-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }

    .m3-processing-icon,
    .m3-download-icon {
        width: 80px;
        height: 80px;
    }

    .m3-processing-icon svg,
    .m3-download-icon svg {
        width: 40px;
        height: 40px;
    }

    .m3-stat-card {
        padding: 1rem 1.5rem;
    }

    .m3-stat-value {
        font-size: 2.5rem;
    }
}

/* ========================================
   STICKY ACTION BAR - Extract Button
   ======================================== */
.m3-sticky-action-bar {
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.98));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(79, 70, 229, 0.15);
    padding: 1rem 0;
    margin-top: 1.5rem;
    z-index: 10;
}

@keyframes slideUpBar {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.m3-sticky-action-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.m3-sticky-selection-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--m3-primary-container, #e0e7ff);
    border-radius: 9999px;
    color: var(--m3-primary, #4f46e5);
    font-size: 0.9rem;
}

.m3-sticky-selection-info svg {
    width: 18px;
    height: 18px;
}

.m3-btn-extract {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--m3-primary, #4f46e5), #6366f1);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
    white-space: nowrap;
}

.m3-btn-extract:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
}

.m3-btn-extract:active {
    transform: scale(0.98);
}

.m3-btn-extract svg {
    width: 20px;
    height: 20px;
}

/* Mobile responsive for sticky bar */
@media (max-width: 480px) {
    .m3-sticky-action-bar {
        padding: 0.75rem;
    }

    .m3-sticky-action-content {
        gap: 0.75rem;
    }

    .m3-sticky-selection-info {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }

    .m3-btn-extract {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* ========================================
   M3 SETTINGS STAGE REDESIGN
   Toolbar, Page Cards, Checkboxes, etc.
   ======================================== */

/* Settings Header */
.m3-settings-panel .settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(79, 70, 229, 0.1);
}

.m3-settings-panel .settings-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.m3-settings-panel .btn-change {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid var(--m3-primary, #4f46e5);
    color: var(--m3-primary, #4f46e5);
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.m3-settings-panel .btn-change:hover {
    background: var(--m3-primary, #4f46e5);
    color: white;
    transform: scale(1.05);
}

/* Selection Toolbar - M3 Redesign */
.m3-settings-panel .selection-toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(79, 70, 229, 0.12);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.m3-settings-panel .selection-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--m3-primary, #4f46e5);
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 1px solid rgba(79, 70, 229, 0.2);
    min-width: auto;
}

.m3-settings-panel .btn-selection-compact {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(79, 70, 229, 0.2);
    background: white;
    color: var(--m3-primary, #4f46e5);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.m3-settings-panel .btn-selection-compact:hover {
    background: var(--m3-primary, #4f46e5);
    color: white;
    transform: scale(1.05);
    border-color: transparent;
}

/* Range Input - M3 Style */
.m3-settings-panel #rangeInput {
    padding: 0.625rem 1rem !important;
    border: 2px solid rgba(79, 70, 229, 0.2) !important;
    border-radius: 12px !important;
    font-size: 0.875rem !important;
    background: white !important;
    transition: all 0.3s !important;
}

.m3-settings-panel #rangeInput:focus {
    border-color: var(--m3-primary, #4f46e5) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
    outline: none !important;
}

/* Toggle Switch - M3 Redesign */
.m3-settings-panel .toggle-switch {
    background: white;
    padding: 0.375rem 0.75rem 0.375rem 0.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.m3-settings-panel .toggle-slider {
    width: 44px;
    height: 24px;
    background: #e2e8f0;
    border-radius: 24px;
}

.m3-settings-panel .toggle-slider:before {
    width: 20px;
    height: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.m3-settings-panel .toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.m3-settings-panel .toggle-label {
    font-size: 0.875rem;
    font-weight: 600;
}

/* ========================================
   PAGE THUMBNAIL CARDS - M3 Design
   ======================================== */

.m3-settings-panel .split-page-card {
    position: relative;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.m3-settings-panel .split-page-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.m3-settings-panel .split-page-card:hover {
    border-color: var(--m3-primary, #4f46e5);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.15);
}

.m3-settings-panel .split-page-card:hover::before {
    opacity: 1;
}

.m3-settings-panel .split-page-card.selected {
    border-color: var(--m3-primary, #4f46e5);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(99, 102, 241, 0.05));
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Custom Checkbox - M3 Style */
.m3-settings-panel .page-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.m3-settings-panel .page-checkbox input[type="checkbox"]:hover {
    border-color: var(--m3-primary, #4f46e5);
}

.m3-settings-panel .page-checkbox input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--m3-primary, #4f46e5), #6366f1);
    border-color: transparent;
}

.m3-settings-panel .page-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

/* Drag Handle - M3 Style */
.m3-settings-panel .drag-handle {
    color: #94a3b8;
    transition: color 0.2s;
    padding: 0.25rem;
}

.m3-settings-panel .drag-handle:hover {
    color: var(--m3-primary, #4f46e5);
}

.m3-settings-panel .split-page-card:hover .drag-handle {
    color: var(--m3-primary, #4f46e5);
}

/* Thumbnail Container */
.m3-settings-panel .page-thumbnail {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* Rotate Buttons - M3 Style */
.m3-settings-panel .btn-rotate {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.m3-settings-panel .btn-rotate:hover {
    border-color: var(--m3-primary, #4f46e5);
    color: var(--m3-primary, #4f46e5);
    background: var(--m3-primary-container, #e0e7ff);
    transform: scale(1.1) rotate(-5deg);
}

/* Page Number */
.m3-settings-panel .page-number {
    font-size: 0.9rem;
    font-weight: 700;
    color: #475569;
    margin-top: 0.5rem;
}

.m3-settings-panel .split-page-card.selected .page-number {
    color: var(--m3-primary, #4f46e5);
}

/* Mobile responsive for settings */
@media (max-width: 768px) {
    .m3-settings-panel .selection-toolbar {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .m3-settings-panel .selection-count {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }

    .m3-settings-panel .btn-selection-compact {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
}