/* Binder Mode Styles */
.binder-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.binder-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 30px;
}

.binder-search-container {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.binder-search-container input {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.1rem;
    min-width: 400px;
    background: white;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #ddd;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.dropdown-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: #f0f0f0;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.binder-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.nav-button {
    background: rgba(255,255,255,0.9);
    border: 2px solid #2196F3;
    color: #2196F3;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.nav-button:hover:not(:disabled) {
    background: #2196F3;
    color: white;
    transform: translateY(-2px);
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background: rgba(255,255,255,0.2);
    padding: 12px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.binder-spread {
    display: flex;
    justify-content: center;
    gap: 20px;
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    height: 700px;
    max-height: 80vh;
}

.binder-page {
    width: 650px;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    position: relative;
    border: 3px solid #ddd;
}

.left-page {
    border-right: 1px solid #ccc;
}

.right-page {
    border-left: 1px solid #ccc;
}

.binder-spine {
    width: 20px;
    background: linear-gradient(to bottom, #333, #555, #333);
    border-radius: 3px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
    position: relative;
}

.binder-spine::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: #777;
    border-radius: 1px;
}

.page-number {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.page-number.left {
    left: -40px;
}

.page-number.right {
    right: -40px;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(var(--binder-columns, 4), 1fr);
    grid-template-rows: repeat(var(--binder-rows, 3), 1fr);
    gap: 12px;
    /* height set dynamically by JavaScript based on available space */
    margin-top: 10px;
}

.binder-slot {
    background: #f8f8f8;
    border: 2px dashed #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    min-height: 0;
    min-width: 0;
}

.binder-slot:hover {
    border-color: #2196F3;
    background: #f0f8ff;
}

.binder-slot.occupied {
    border: 2px solid #4CAF50;
    background: white;
    padding: 5px;
}

.binder-slot.occupied:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.binder-slot.owned {
    border-color: #4CAF50;
}

.binder-slot.unowned {
    border-color: #f44336;
    background: #f9f9f9;
}

.slot-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.slot-image.greyscale {
    filter: grayscale(100%) opacity(0.6);
}

.slot-placeholder {
    color: #999;
    font-size: 0.8rem;
    text-align: center;
}

/* Binder responsive design */
@media (max-width: 1200px) {
    .binder-spread {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .binder-spine {
        height: 20px;
        width: 500px;
        background: linear-gradient(to right, #333, #555, #333);
    }
    
    .binder-spine::before {
        top: 50%;
        transform: translateY(-50%);
        left: 20px;
        right: 20px;
        width: auto;
        height: 2px;
    }
}

@media (max-width: 768px) {
    .binder-container {
        padding: 10px;
    }
    
    .binder-page {
        width: 100%;
        max-width: 500px;
        padding: 15px;
    }
    
    .slots-grid {
        gap: 8px;
    }
    
    .binder-controls {
        flex-direction: column;
        gap: 20px;
    }
    
    .binder-search-container {
        max-width: none;
        width: 100%;
    }
    
    .binder-search-container input {
        min-width: auto;
        width: 100%;
        font-size: 1rem;
    }
    
    .binder-nav {
        justify-content: center;
    }
    
    .nav-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .page-info {
        font-size: 1rem;
        padding: 8px 15px;
    }
    
    .binder-spread {
        padding: 20px 15px;
        height: auto;
        min-height: 500px;
    }
}

@media (max-width: 480px) {
    .binder-page {
        max-width: 350px;
        padding: 10px;
    }
    
    .slots-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
        gap: 6px;
    }
    
    .binder-search-container input {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .nav-button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .page-info {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}