/* Summarizer Tool Specific Styles */

.summarizer-container {
    display: flex;
    min-height: calc(100vh - 80px); /* Fill remaining viewport */
    margin-top: 0; /* Reset margin as tool-intro handles initial space */
    position: relative;
    z-index: 1;
    gap: 0;
}

.document-preview {
    flex: 1;
    padding: 20px 40px 40px;
    background: var(--black);
    overflow-y: auto;
    overflow-x: auto; /* Enable horizontal scrolling for zoom */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 80px); /* Fill remaining viewport */
}

#summarize-sidebar {
    width: 380px;
    min-width: 380px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: 25px;
    height: calc(100vh - 80px);
    position: sticky;
    top: 80px; /* Adjusted for fixed header height */
    display: none; /* Shown after Continue */
    flex-direction: column;
    z-index: 10;
    box-sizing: border-box;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none; /* Initial hidden */
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.5);
    animation: modalIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Settings Options */
.settings-section {
    margin-bottom: 30px;
}

.settings-section label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Segmented Control / Slider Replacement */
.length-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.length-option {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    color: var(--text-muted);
}

.length-option.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
}

/* AI Mode Cards */
.mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.mode-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.mode-card.active {
    border-color: var(--primary);
    background: rgba(231, 76, 60, 0.1);
}

.mode-card i {
    font-size: 1.2rem;
    margin-bottom: 10px;
    display: block;
    color: var(--text-muted);
}

.mode-card.active i {
    color: var(--primary);
}

.mode-card span {
    font-weight: 700;
    font-size: 0.9rem;
    display: block;
}

.tool-intro {
    display: block; /* Keep container for JS targeting, but remove internal layout overrides */
}

/* Sidebar Styles */
.sidebar-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.sidebar-header h2 {
    font-size: 1.4rem;
    margin: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 25px;
    border-top: 1px solid var(--border);
}

.summary-output {
    flex: 1;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 20px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.summary-output h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.summary-output p {
    margin-bottom: 15px;
}

.summary-output ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.summary-output li {
    margin-bottom: 10px;
}

/* Compact Preview Styles */
#pages-grid {
    display: flex;
    justify-content: flex-start; /* Aligned to start for better scroll behavior when zoomed */
    width: 100%;
    margin-bottom: 30px;
}

#pages-grid .page-thumbnail {
    width: auto; /* Let content dictate width */
    max-width: none; /* Remove previous restriction */
    margin: 0 auto; /* Centering within flex container if possible */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    background: white;
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

#pages-grid .page-thumbnail:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

#pages-grid .page-thumbnail canvas {
    width: auto; /* Natural size from rendered PDF */
    height: auto;
    max-width: 100%; /* Default safety, but effectively ignored if container is wider */
    border-radius: 8px;
    display: block; /* Remove baseline spacing */
}

#pages-grid .page-number {
    display: inline-block;
    background: var(--primary);
    color: white !important;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 800;
    margin-top: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Zoom Toolbar Styles */
.zoom-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 25px;
    border-radius: 50px;
    border: 1px solid var(--border);
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    animation: fadeIn 0.5s ease;
}

.zoom-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
}

.zoom-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-main);
    min-width: 80px;
    justify-content: center;
}

.zoom-status i {
    color: var(--primary);
    font-size: 0.85rem;
    opacity: 0.8;
}

.zoom-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 5px;
}


