/* split.css - Workspace & Page Selection Styling */
@import url('merge.css'); /* Reuse centering and button styles */

/* SIDEBAR SETTINGS */
.settings-group {
    margin-bottom: 25px;
}

.settings-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main); /* Adaptive text */
}

.settings-group select, 
.settings-group input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-page); /* Adaptive background */
    color: var(--text-main);
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.settings-group input:focus {
    border-color: var(--primary);
}

/* SELECTION CONTROLS (NEW) */
.selection-controls .btn-outline {
    background: var(--bg-page); /* Adaptive theme background */
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 600;
    transition: 0.2s;
    cursor: pointer;
    border-radius: 8px; /* Matching the card radius */
}

.selection-controls .btn-outline:hover {
    border-color: var(--primary);
    background: var(--bg-zone); /* Slight background shift on hover */
}

/* THUMBNAIL GRID LAYOUT */
#thumbnailGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 25px;
    padding: 40px;
    background: var(--bg-zone); /* Adapts to theme */
    min-height: 100%;
    align-content: flex-start;
    overflow-y: auto;
}

/* INDIVIDUAL PAGE CARD */
.page-card {
    background: var(--card-bg); /* Adapts to theme */
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow);
}

.page-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

/* THE SELECTION (TICKED) STATE */
.page-card.selected {
    border-color: var(--primary);
    background: rgba(229, 62, 62, 0.08); /* Subtle brand tint */
}

/* THE TICK ICON */
.page-card.selected::before {
    content: "✅";
    position: absolute;
    top: -12px;
    right: -12px;
    font-size: 22px;
    background: var(--bg-page); /* Background matches theme */
    border-radius: 50%;
    box-shadow: var(--shadow);
    z-index: 2;
}

/* PREVIEW CONTAINER */
.preview-container {
    width: 100%;
    height: 160px;
    background: #f8f9fa;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
}

.page-preview-canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Maintains aspect ratio */
}

.page-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

/* COMPATIBILITY STYLES */
.page-thumbnail {
    width: 120px;
    height: 160px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.page-number {
    position: absolute;
    bottom: 5px;
    font-size: 10px;
    color: var(--text-muted);
}